Skip to content

Commit

Permalink
OZ-457: Fix issue with Nginx crashing when upstream server is not ava…
Browse files Browse the repository at this point in the history
…ilable (#67)
  • Loading branch information
enyachoke authored Jan 10, 2024
1 parent d477745 commit 2d03391
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
39 changes: 14 additions & 25 deletions proxy/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,6 @@ upstream backend {
server openmrs:8080 max_fails=0;
}

upstream odoo {
server odoo:8069 max_fails=0;
}
upstream odoochat {
server odoo:8072 max_fails=0;
}



upstream senaite {
server senaite:8080 max_fails=0;
}

upstream superset {
server superset:8088 max_fails=0;
}

server {
listen 80;

Expand Down Expand Up @@ -139,18 +122,22 @@ server {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo;
set $odoo odoo:8069;
proxy_pass http://$odoo;
}

location / {
proxy_pass http://odoo;
# The following makes the timeout broader
proxy_read_timeout 30000;
proxy_redirect off;

set $odoo odoo:8069;
proxy_pass http://$odoo;
# The following makes the timeout broader
proxy_read_timeout 30000;
proxy_redirect off;
}

location /longpolling {
proxy_pass http://odoochat;
set $odoo odoo:8072;
proxy_pass http://$odoo;
}
}

Expand All @@ -159,7 +146,8 @@ server {
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://superset;
set $superset superset:8088;
proxy_pass http://$superset;
}
}

Expand All @@ -170,6 +158,7 @@ server {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
rewrite ^(.*)$ /VirtualHostBase/$scheme/$host/senaite/VirtualHostRoot/$1 break;
proxy_pass http://senaite;
set $senaite senaite:8080;
proxy_pass http://$senaite;
}
}
1 change: 1 addition & 0 deletions proxy/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ http {
tcp_nodelay on;

keepalive_timeout 65;
resolver 127.0.0.11;

include /etc/nginx/conf.d/*.conf;
}

0 comments on commit 2d03391

Please sign in to comment.