158 lines
4.1 KiB
Nginx Configuration File
158 lines
4.1 KiB
Nginx Configuration File
events {
|
|
worker_connections 1024; ## Default: 1024
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
|
|
upstream backend {
|
|
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
|
|
|
|
# Unix domain servers
|
|
# server unix:/tmp/backend-gisaf-1.sock fail_timeout=0;
|
|
}
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
#
|
|
#upstream websocket {
|
|
# server localhost:8080;
|
|
#}
|
|
|
|
|
|
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
|
|
gzip on;
|
|
gzip_types text/plain application/xml;
|
|
gzip_proxied no-cache no-store private expired auth;
|
|
gzip_min_length 1000;
|
|
|
|
charset utf-8;
|
|
|
|
client_max_body_size 4G;
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
location /tiles/ {
|
|
# proxy_pass http://localhost:8080/;
|
|
#proxy_pass http://127.0.0.1:3000/;
|
|
proxy_pass http://backend;
|
|
}
|
|
|
|
location /api/ {
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_http_version 1.1;
|
|
proxy_buffering off;
|
|
proxy_pass http://backend;
|
|
}
|
|
|
|
location /gj/live {
|
|
proxy_pass http://backend;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade "websocket";
|
|
proxy_set_header Connection "Upgrade";
|
|
proxy_buffering off;
|
|
}
|
|
|
|
location /_sched {
|
|
proxy_pass http://localhost:8080;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade "websocket";
|
|
proxy_set_header Connection "Upgrade";
|
|
proxy_buffering off;
|
|
}
|
|
|
|
location /gj/ {
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_http_version 1.1;
|
|
proxy_buffering off;
|
|
proxy_pass http://backend;
|
|
}
|
|
|
|
location /auth {
|
|
## POST requests for JWT
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_http_version 1.1;
|
|
proxy_buffering off;
|
|
proxy_pass http://backend;
|
|
}
|
|
|
|
# location /admin {
|
|
# proxy_set_header Host $http_host;
|
|
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
# proxy_http_version 1.1;
|
|
# proxy_buffering off;
|
|
# proxy_pass http://backend;
|
|
# }
|
|
|
|
location /import/ {
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_http_version 1.1;
|
|
proxy_buffering off;
|
|
proxy_pass http://backend;
|
|
}
|
|
|
|
location /download/ {
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_http_version 1.1;
|
|
proxy_buffering off;
|
|
proxy_pass http://backend;
|
|
}
|
|
|
|
location /upload/ {
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_http_version 1.1;
|
|
proxy_buffering off;
|
|
proxy_pass http://backend;
|
|
}
|
|
|
|
location /embed/ {
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_http_version 1.1;
|
|
proxy_buffering off;
|
|
proxy_pass http://backend;
|
|
}
|
|
|
|
location = /index.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri /index.html;
|
|
}
|
|
|
|
location /dashboard-attachment {
|
|
alias /home/phil/gisaf_misc/notebooks;
|
|
}
|
|
|
|
location = /favicon.ico {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
|
|
# location /terrain {
|
|
# proxy_pass https://stamen-tiles-a.a.ssl.fastly.net/terrain;
|
|
# #proxy_set_header Host $host;
|
|
# proxy_buffering on;
|
|
# proxy_cache STAMEN;
|
|
# proxy_cache_valid 200 1d;
|
|
# proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
|
|
# }
|
|
|
|
# location "/download/attachment/formidable:trees/Picture/" {
|
|
# alias /home/phil/formidable_src/local_data/;
|
|
# }
|
|
}
|
|
}
|