From c0b88fe7366fc19149c7cfc9fc80bdd32e6b32dc Mon Sep 17 00:00:00 2001 From: bigbug Date: Fri, 30 Aug 2024 15:16:13 +0800 Subject: Nginx reverse proxy setting (#2504) * Nginx reverse proxy web Reverse proxy root path or subpath * Update README.md * Fix ru_RU doc translation * Fix translation issues Fix similar problems with other translations --- README.zh_CN.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'README.zh_CN.md') diff --git a/README.zh_CN.md b/README.zh_CN.md index a148134c..14ac8de4 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -178,6 +178,42 @@ systemctl restart x-ui +## Nginx 设置 +
+ 点击查看 反向代理配置 + +#### Nginx反向代理 +```nginx +location / { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Range $http_range; + proxy_set_header If-Range $http_if_range; + proxy_redirect off; + proxy_pass http://127.0.0.1:2053; +} +``` + +#### Nginx子路径 +- 确保 `/sub` 面板设置中的"面板url根路径"一致 +- 面板设置中的 `url` 需要以 `/` 结尾 + +```nginx +location /sub { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Range $http_range; + proxy_set_header If-Range $http_if_range; + proxy_redirect off; + proxy_pass http://127.0.0.1:2053; +} +``` +
+ ## 建议使用的操作系统 - Ubuntu 20.04+ -- cgit v1.2.3