Add additional timeout configuration to nginx.dev.conf.hbs

This commit is contained in:
Rory Powell 2022-10-13 11:26:25 +01:00
parent 9c55bbf9cf
commit 36f122a0af
1 changed files with 57 additions and 9 deletions

View File

@ -24,6 +24,21 @@ http {
default "upgrade"; default "upgrade";
} }
upstream app-service {
server {{address}}:4001;
keepalive 32;
}
upstream worker-service {
server {{address}}:4002;
keepalive 32;
}
upstream builder {
server {{address}}:3000;
keepalive 32;
}
server { server {
listen 10000 default_server; listen 10000 default_server;
server_name _; server_name _;
@ -43,45 +58,78 @@ http {
} }
location ~ ^/api/(system|admin|global)/ { location ~ ^/api/(system|admin|global)/ {
proxy_pass http://{{ address }}:4002; proxy_pass http://worker-service;
proxy_read_timeout 120s;
proxy_connect_timeout 120s;
proxy_send_timeout 120s;
proxy_http_version 1.1;
proxy_set_header Connection "";
} }
location /api/ { location /api/ {
proxy_read_timeout 120s; proxy_read_timeout 120s;
proxy_connect_timeout 120s; proxy_connect_timeout 120s;
proxy_send_timeout 120s; proxy_send_timeout 120s;
proxy_pass http://{{ address }}:4001; proxy_pass http://app-service;
proxy_http_version 1.1;
proxy_set_header Connection "";
} }
location = / { location = / {
proxy_pass http://{{ address }}:4001; proxy_pass http://app-service;
proxy_read_timeout 120s;
proxy_connect_timeout 120s;
proxy_send_timeout 120s;
proxy_http_version 1.1;
proxy_set_header Connection "";
} }
location /app_ { location /app_ {
proxy_pass http://{{ address }}:4001; proxy_pass http://app-service;
proxy_read_timeout 120s;
proxy_connect_timeout 120s;
proxy_send_timeout 120s;
proxy_http_version 1.1;
proxy_set_header Connection "";
} }
location /app { location /app {
proxy_pass http://{{ address }}:4001; proxy_pass http://app-service;
proxy_read_timeout 120s;
proxy_connect_timeout 120s;
proxy_send_timeout 120s;
proxy_http_version 1.1;
proxy_set_header Connection "";
} }
location /builder { location /builder {
proxy_pass http://{{ address }}:3000; proxy_pass http://builder;
proxy_read_timeout 120s;
proxy_connect_timeout 120s;
proxy_send_timeout 120s;
proxy_http_version 1.1;
proxy_set_header Connection "";
rewrite ^/builder(.*)$ /builder/$1 break; rewrite ^/builder(.*)$ /builder/$1 break;
} }
location /builder/ { location /builder/ {
proxy_pass http://{{ address }}:3000; proxy_pass http://builder;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade; proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
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;
proxy_read_timeout 120s;
proxy_connect_timeout 120s;
proxy_send_timeout 120s;
} }
location /vite/ { location /vite/ {
proxy_pass http://{{ address }}:3000; proxy_pass http://builder;
proxy_read_timeout 120s;
proxy_connect_timeout 120s;
proxy_send_timeout 120s;
rewrite ^/vite(.*)$ /$1 break; rewrite ^/vite(.*)$ /$1 break;
} }
@ -91,7 +139,7 @@ http {
proxy_set_header Connection 'upgrade'; proxy_set_header Connection 'upgrade';
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade; proxy_cache_bypass $http_upgrade;
proxy_pass http://{{ address }}:4001; proxy_pass http://app-service;
} }
location / { location / {