Container: update nginx config
All checks were successful
/ build (push) Successful in 30s

This commit is contained in:
phil 2024-12-16 19:42:48 +01:00
parent f737fd2ce9
commit c7a0ae934a

View file

@ -4,143 +4,143 @@ events {
http { http {
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
upstream aiohttp {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response
# Unix domain servers upstream backend {
# server unix:/tmp/aiohttp-gisaf-1.sock fail_timeout=0; server gisaf-backend:8898 fail_timeout=0;
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response
server 127.0.0.1:5000 fail_timeout=0; # Unix domain servers
} # server unix:/tmp/backend-gisaf-1.sock fail_timeout=0;
}
map $http_upgrade $connection_upgrade { map $http_upgrade $connection_upgrade {
default upgrade; default upgrade;
'' close; '' close;
} }
# #
#upstream websocket { #upstream websocket {
# server localhost:8080; # server localhost:8080;
#} #}
server { server {
listen 8899; listen 8899;
gzip on; gzip on;
gzip_types text/plain application/xml; gzip_types text/plain application/xml;
gzip_proxied no-cache no-store private expired auth; gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000; gzip_min_length 1000;
server_name localhost; server_name localhost;
charset utf-8; charset utf-8;
client_max_body_size 4G; client_max_body_size 4G;
root /usr/share/nginx/html; root /usr/share/nginx/html;
location /tiles/ { location /tiles/ {
# proxy_pass http://localhost:8080/; # proxy_pass http://localhost:8080/;
#proxy_pass http://127.0.0.1:3000/; #proxy_pass http://127.0.0.1:3000/;
proxy_pass http://aiohttp; proxy_pass http://backend;
} }
location /api/ { location /api/ {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_buffering off; proxy_buffering off;
proxy_pass http://aiohttp; proxy_pass http://backend;
} }
location /gj/live { location /gj/live {
proxy_pass http://aiohttp; proxy_pass http://backend;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade "websocket"; proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade"; proxy_set_header Connection "Upgrade";
proxy_buffering off; proxy_buffering off;
} }
location /_sched { location /_sched {
proxy_pass http://localhost:8080; proxy_pass http://localhost:8080;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade "websocket"; proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade"; proxy_set_header Connection "Upgrade";
proxy_buffering off; proxy_buffering off;
} }
location /gj/ { location /gj/ {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_buffering off; proxy_buffering off;
proxy_pass http://aiohttp; proxy_pass http://backend;
} }
location /auth { location /auth {
## POST requests for JWT ## POST requests for JWT
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_buffering off; proxy_buffering off;
proxy_pass http://aiohttp; proxy_pass http://backend;
} }
# location /admin { # location /admin {
# proxy_set_header Host $http_host; # proxy_set_header Host $http_host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_http_version 1.1; # proxy_http_version 1.1;
# proxy_buffering off; # proxy_buffering off;
# proxy_pass http://aiohttp; # proxy_pass http://backend;
# } # }
location /import/ { location /import/ {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_buffering off; proxy_buffering off;
proxy_pass http://aiohttp; proxy_pass http://backend;
} }
location /download/ { location /download/ {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_buffering off; proxy_buffering off;
proxy_pass http://aiohttp; proxy_pass http://backend;
} }
location /upload/ { location /upload/ {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_buffering off; proxy_buffering off;
proxy_pass http://aiohttp; proxy_pass http://backend;
} }
location /embed/ { location /embed/ {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_buffering off; proxy_buffering off;
proxy_pass http://aiohttp; proxy_pass http://backend;
} }
location = /index.html { location = /index.html {
root /usr/share/nginx/html; root /usr/share/nginx/html;
} }
location / { location / {
try_files $uri /index.html; try_files $uri /index.html;
} }
location /dashboard-attachment { location /dashboard-attachment {
alias /home/phil/gisaf_misc/notebooks; alias /home/phil/gisaf_misc/notebooks;
} }
location = /favicon.ico { location = /favicon.ico {
root /usr/share/nginx/html; root /usr/share/nginx/html;
} }
# location /terrain { # location /terrain {
# proxy_pass https://stamen-tiles-a.a.ssl.fastly.net/terrain; # proxy_pass https://stamen-tiles-a.a.ssl.fastly.net/terrain;
@ -154,5 +154,5 @@ server {
# location "/download/attachment/formidable:trees/Picture/" { # location "/download/attachment/formidable:trees/Picture/" {
# alias /home/phil/formidable_src/local_data/; # alias /home/phil/formidable_src/local_data/;
# } # }
} }
} }