server { listen 8080; root /usr/share/nginx/html; resolver 127.0.0.11 valid=10s ipv6=off; location /api/ { set $api http://beacon:8080; proxy_pass $api; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /ws { set $api http://beacon:8080; proxy_pass $api; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; # Beacon compares the browser's Origin with Host, including the LAN port. proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $remote_addr; proxy_read_timeout 3600s; } location /assets/ { add_header Cache-Control "public, max-age=31536000, immutable"; try_files $uri =404; } location / { add_header Cache-Control "no-cache"; try_files $uri $uri/index.html /index.html; } }