fling/container/etc/nginx/conf.d/fling.conf
Armin Friedl 2b18120c0b
All checks were successful
continuous-integration/drone/push Build is passing
Try client generator
2020-07-03 21:02:48 +02:00

77 lines
2.3 KiB
Text

server {
listen 3000;
listen [::]:3000;
server_name _;
root /var/www/fling;
# config to enable HSTS(HTTP Strict Transport Security)
add_header Strict-Transport-Security "max-age=15552000; includeSubdomains;";
# forward /api requests to tomcat
location /api {
proxy_pass http://localhost:8080;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
# Required for web sockets to function
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Allow huge file uploads
client_max_body_size 5G;
}
# handle openapi requests by openapi servlet
location /v3/api-docs {
proxy_pass http://localhost:8080;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
# Required for web sockets to function
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# handle openapi requests by openapi servlet
location /swagger-ui.html {
proxy_pass http://localhost:8080;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
# Required for web sockets to function
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# always respond with index.html for unknown paths
# (routing is client side)
location / {
try_files $uri /index.html;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}