mirror of
http://junepve.top:3000/chicrobot/README.git
synced 2026-10-30 06:41:29 +08:00
更新 c1_docker运行nginx.md
This commit is contained in:
1 parent
26b7afeccf
commit
86ff9ff976
1 file changed
+25
@@ -31,3 +31,28 @@ sudo vi ~/data/nginx/conf.d/default.conf
|
|||||||
sudo docker exec nginx nginx -t # 在nginx容器内执行nginx -t检查配置语法
|
sudo docker exec nginx nginx -t # 在nginx容器内执行nginx -t检查配置语法
|
||||||
sudo docker exec nginx nginx -s reload # 重新加载配置
|
sudo docker exec nginx nginx -s reload # 重新加载配置
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 配置代理
|
||||||
|
路径代理
|
||||||
|
```
|
||||||
|
location /uri {
|
||||||
|
alias /path;
|
||||||
|
index index.html;
|
||||||
|
try_files $uri $uri/ /uri/;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
端口代理
|
||||||
|
```
|
||||||
|
location /uri/ {
|
||||||
|
proxy_pass http://127.0.0.1:port/;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
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 X-Forwarded-Proto $scheme;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
}
|
||||||
|
```
|
||||||
Reference in new issue
Block a user