mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-20 05:52:24 +00:00
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
This commit is contained in:
parent
fa43248e30
commit
c0b88fe736
4 changed files with 141 additions and 0 deletions
|
@ -177,6 +177,41 @@ eliminar 3x-ui de docker
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
## Configuración de Nginx
|
||||||
|
<details>
|
||||||
|
<summary>Haga clic aquí para configurar el proxy inverso</summary>
|
||||||
|
|
||||||
|
#### Proxy inverso 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-path
|
||||||
|
- EAsegúrese de que la "Ruta Raíz de la URL del Panel" en la configuración del panel `/sub` es la misma.
|
||||||
|
- El `url` en la configuración del panel debe terminar con `/`.
|
||||||
|
|
||||||
|
```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;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
## SO Recomendados
|
## SO Recomendados
|
||||||
|
|
||||||
|
|
35
README.md
35
README.md
|
@ -202,6 +202,41 @@ systemctl restart x-ui
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
## Nginx Settings
|
||||||
|
<details>
|
||||||
|
<summary>Click for Reverse Proxy Configuration</summary>
|
||||||
|
|
||||||
|
#### Nginx Reverse Proxy
|
||||||
|
```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-path
|
||||||
|
- Ensure that the "URI Path" in the `/sub` panel settings is the same.
|
||||||
|
- The `url` in the panel settings needs to end with `/`.
|
||||||
|
|
||||||
|
```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;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
## Recommended OS
|
## Recommended OS
|
||||||
|
|
||||||
|
|
|
@ -201,6 +201,41 @@ systemctl restart x-ui
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
## Настройки Nginx
|
||||||
|
<details>
|
||||||
|
<summary>Нажмите чтобы просмотреть конфигурацию обратного прокси-сервера</summary>
|
||||||
|
|
||||||
|
#### Обратный прокси-сервер 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-path
|
||||||
|
- Убедитесь, что "корневой путь URL адреса панели" в настройках панели и `/sub` совпадают.
|
||||||
|
- В настройках панели `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;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
## Рекомендуемые ОС
|
## Рекомендуемые ОС
|
||||||
|
|
||||||
|
|
|
@ -178,6 +178,42 @@ systemctl restart x-ui
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
## Nginx 设置
|
||||||
|
<details>
|
||||||
|
<summary>点击查看 反向代理配置</summary>
|
||||||
|
|
||||||
|
#### 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;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
## 建议使用的操作系统
|
## 建议使用的操作系统
|
||||||
|
|
||||||
- Ubuntu 20.04+
|
- Ubuntu 20.04+
|
||||||
|
|
Loading…
Reference in a new issue