fix: nginx proxy_pass host and port as separate variables
backend: 4000 in one variable breaks nginx upstream resolution; split host and port for dynamic Docker DNS. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
b83f360ec2
commit
64c9db3dab
@ -13,8 +13,9 @@ server {
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
set $api_upstream backend:4000;
|
||||
proxy_pass http://$api_upstream/api/;
|
||||
set $api_host backend;
|
||||
set $api_port 4000;
|
||||
proxy_pass http://$api_host:$api_port;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@ -23,8 +24,9 @@ server {
|
||||
}
|
||||
|
||||
location /ws/ {
|
||||
set $ws_upstream backend-ws:4001;
|
||||
proxy_pass http://$ws_upstream;
|
||||
set $ws_host backend-ws;
|
||||
set $ws_port 4001;
|
||||
proxy_pass http://$ws_host:$ws_port;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
@ -36,8 +38,9 @@ server {
|
||||
}
|
||||
|
||||
location / {
|
||||
set $web_upstream prediqo_web:80;
|
||||
proxy_pass http://$web_upstream/;
|
||||
set $web_host prediqo_web;
|
||||
set $web_port 80;
|
||||
proxy_pass http://$web_host:$web_port;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
@ -28,8 +28,9 @@ server {
|
||||
client_max_body_size 20m;
|
||||
|
||||
location /api/ {
|
||||
set $api_upstream backend:4000;
|
||||
proxy_pass http://$api_upstream/api/;
|
||||
set $api_host backend;
|
||||
set $api_port 4000;
|
||||
proxy_pass http://$api_host:$api_port;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@ -38,8 +39,9 @@ server {
|
||||
}
|
||||
|
||||
location /ws/ {
|
||||
set $ws_upstream backend-ws:4001;
|
||||
proxy_pass http://$ws_upstream;
|
||||
set $ws_host backend-ws;
|
||||
set $ws_port 4001;
|
||||
proxy_pass http://$ws_host:$ws_port;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
@ -51,8 +53,9 @@ server {
|
||||
}
|
||||
|
||||
location / {
|
||||
set $web_upstream prediqo_web:80;
|
||||
proxy_pass http://$web_upstream/;
|
||||
set $web_host prediqo_web;
|
||||
set $web_port 80;
|
||||
proxy_pass http://$web_host:$web_port;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
@ -26,8 +26,9 @@ server {
|
||||
client_max_body_size 20m;
|
||||
|
||||
location /api/ {
|
||||
set $api_upstream backend:4000;
|
||||
proxy_pass http://$api_upstream/api/;
|
||||
set $api_host backend;
|
||||
set $api_port 4000;
|
||||
proxy_pass http://$api_host:$api_port;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@ -36,8 +37,9 @@ server {
|
||||
}
|
||||
|
||||
location /ws/ {
|
||||
set $ws_upstream backend-ws:4001;
|
||||
proxy_pass http://$ws_upstream;
|
||||
set $ws_host backend-ws;
|
||||
set $ws_port 4001;
|
||||
proxy_pass http://$ws_host:$ws_port;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
@ -49,8 +51,9 @@ server {
|
||||
}
|
||||
|
||||
location / {
|
||||
set $web_upstream prediqo_web:80;
|
||||
proxy_pass http://$web_upstream/;
|
||||
set $web_host prediqo_web;
|
||||
set $web_port 80;
|
||||
proxy_pass http://$web_host:$web_port;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user