server { listen 80 default_server; # Gzip Settings gzip off; gzip_disable "msie6"; gzip_min_length 1k; gzip_buffers 16 64k; gzip_http_version 1.1; gzip_comp_level 6; gzip_types *; root /app; # normal routes # serve given url and default to index.html if not found # e.g. /, /user and /foo/bar will return index.html location / { try_files $uri $uri/index.html /index.html; add_header Cache-Control "private,no-cache"; add_header Last-Modified "Oct, 03 Jan 2022 13:46:41 GMT"; expires 0; } location /bfl/ { add_header Access-Control-Allow-Headers "access-control-allow-headers,access-control-allow-methods,access-control-allow-origin,content-type,x-auth,x-unauth-error,x-authorization"; proxy_pass http://bfl; proxy_set_header Host $host; proxy_set_header X-real-ip $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header X-Frame-Options SAMEORIGIN; } location /api/firstfactor { add_header Access-Control-Allow-Headers "access-control-allow-headers,access-control-allow-methods,access-control-allow-origin,content-type,x-auth,x-unauth-error,x-authorization"; add_header Access-Control-Allow-Methods "PUT, GET, DELETE, POST, OPTIONS"; add_header Access-Control-Allow-Origin $http_origin; add_header Access-Control-Allow-Credentials true; proxy_pass http://authelia-backend-svc:9091; proxy_set_header Host $host; proxy_set_header X-real-ip $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header X-Frame-Options SAMEORIGIN; } location /api/secondfactor/totp { add_header Access-Control-Allow-Headers "access-control-allow-headers,access-control-allow-methods,access-control-allow-origin,content-type,x-auth,x-unauth-error,x-authorization"; add_header Access-Control-Allow-Methods "PUT, GET, DELETE, POST, OPTIONS"; add_header Access-Control-Allow-Origin $http_origin; add_header Access-Control-Allow-Credentials true; proxy_pass http://authelia-backend-svc:9091; proxy_set_header Host $host; proxy_set_header X-real-ip $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header X-Frame-Options SAMEORIGIN; } location /api/refresh { add_header Access-Control-Allow-Headers "access-control-allow-headers,access-control-allow-methods,access-control-allow-origin,content-type,x-auth,x-unauth-error,x-authorization"; add_header Access-Control-Allow-Methods "PUT, GET, DELETE, POST, OPTIONS"; add_header Access-Control-Allow-Origin $http_origin; add_header Access-Control-Allow-Credentials true; proxy_pass http://authelia-backend-svc:9091; proxy_set_header Host $host; proxy_set_header X-real-ip $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header X-Frame-Options SAMEORIGIN; } location /server { proxy_pass http://vault-server:3000; # rewrite ^/server(.*)$ $1 break; # Add original-request-related headers proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; } # # files # # for all routes matching a dot, check for files and return 404 if not found # # e.g. /file.js returns a 404 if not found location ~.*\.(js|css|png|jpg|svg|woff|woff2)$ { add_header Cache-Control "public, max-age=2678400"; } }