mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
调整nginx配置,预置socket代理
This commit is contained in:
parent
9bd7bef48f
commit
78a03e6149
41
nginx.conf
41
nginx.conf
@ -14,6 +14,9 @@ http {
|
|||||||
access_log /var/log/nginx/access.log main;
|
access_log /var/log/nginx/access.log main;
|
||||||
sendfile on;
|
sendfile on;
|
||||||
keepalive_timeout 65;
|
keepalive_timeout 65;
|
||||||
|
upstream backend {
|
||||||
|
server midway:7001;
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
@ -25,7 +28,7 @@ http {
|
|||||||
}
|
}
|
||||||
location /api/
|
location /api/
|
||||||
{
|
{
|
||||||
proxy_pass http://midway:7001/;
|
proxy_pass http://backend/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
@ -48,6 +51,42 @@ http {
|
|||||||
|
|
||||||
#expires 12h;
|
#expires 12h;
|
||||||
}
|
}
|
||||||
|
location /im {
|
||||||
|
proxy_pass http://backend/im;
|
||||||
|
proxy_connect_timeout 3600s; #配置点1
|
||||||
|
proxy_read_timeout 3600s; #配置点2,如果没效,可以考虑这个时间配置长一点
|
||||||
|
proxy_send_timeout 3600s; #配置点3
|
||||||
|
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_bind $remote_addr transparent;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
# rewrite /socket/(.*) /$1 break;
|
||||||
|
proxy_redirect off;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
location /socket {
|
||||||
|
proxy_pass http://backend/socket;
|
||||||
|
proxy_connect_timeout 3600s; #配置点1
|
||||||
|
proxy_read_timeout 3600s; #配置点2,如果没效,可以考虑这个时间配置长一点
|
||||||
|
proxy_send_timeout 3600s; #配置点3
|
||||||
|
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_bind $remote_addr transparent;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
rewrite /socket/(.*) /$1 break;
|
||||||
|
proxy_redirect off;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
location /adminer/
|
location /adminer/
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user