website/nginx.conf
kolaente 39da1e4132
All checks were successful
continuous-integration/drone/push Build is passing
fix: only pass /api/ routes to nginx
This fixes rendering of 404 routes.
2024-09-23 10:45:43 +02:00

59 lines
1.6 KiB
Nginx Configuration File

# Expires map
map $sent_http_content_type $expires {
default off;
text/html epoch; # We don't cache the html for the browser to get the content
text/css max;
application/javascript max;
~image/ max;
~font/ max;
}
server {
listen 80;
server_name _;
expires $expires;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml font/woff2 image/x-icon;
charset utf-8;
location / {
root /app/dist/client/;
try_files $uri $uri/index.html =404;
}
location /survey {
return 302 https://forms.reform.app/oSTwrh/vikunja-feedback;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location /api/ {
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_pass http://127.0.0.1:4321;
}
}