Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: supports deploying memos to a subfolder of the domain name. #3845

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

eaglexmw-gmail
Copy link

like this: [www.example.com/memos].

with nginx reverse config:
proxy_pass http://xxx:5230/;

@eaglexmw-gmail
Copy link
Author

hi, @boojack, I've done a new feature that supports deploying Memos under a subfolder of the domain name. Please review it and let me know if it can be merged into master.

@eaglexmw-gmail
Copy link
Author

@boojack 新特性:支持将memos部署到域名的子目录下;
特性同时支持部署在根目录与子目录,默认为部署在根目录。
部署到子目录下,nginx的配置类似如下即可:

location ^~ /memos/ {
    # 注意: 反向代理后端 URL 的最后需要有一个路径符号
    proxy_pass http://127.0.0.1:5230/;

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr; # 设置请求源地址
    proxy_set_header X-Forwarded-Proto $scheme; # 设置Http协议
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    add_header X-Cache $upstream_cache_status;
    #Set Nginx Cache
    add_header Cache-Control no-cache;
    #expires 12h;
}

@Issues-translate-bot
Copy link

Issue is not in English. It has been translated automatically.


@boojack New feature: supports deploying memos to subdirectories of domain names;
The feature supports deployment in both the root directory and subdirectories, and the default is deployment in the root directory.
Deployed to a subdirectory, the nginx configuration is similar to the following:

location ^~ /memos/ {
    # Note: The reverse proxy backend URL needs to have a path symbol at the end
    proxy_pass http://127.0.0.1:5230/;

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr; # Set the request source address
    proxy_set_header X-Forwarded-Proto $scheme; # Set Http protocol
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    add_header X-Cache $upstream_cache_status;
    #Set Nginx Cache
    add_header Cache-Control no-cache;
    #expires 12h;
}  

Copy link

@okainov okainov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure adding Makefile is in line with general project idea, but that's up to the maintainer anyway :) Thanks for the docs, looks good to start with :)

@eaglexmw-gmail
Copy link
Author

@boojack

@Issues-translate-bot
Copy link

Issue is not in English. It has been translated automatically.


@boojack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants