# The reverse proxy strips /m before forwarding, so files are looked up at the root. # The "/m/" form is also accepted for direct access. server { listen 10003; root /usr/share/nginx/html; index index.html; rewrite ^/m/(.*)$ /$1 last; # Published Android updates; open CORS because the app runs on https://localhost. location /android/ { alias /updates/; add_header Access-Control-Allow-Origin "*"; add_header Cache-Control "no-cache"; try_files $uri =404; } location /assets/ { add_header Cache-Control "public, max-age=31536000, immutable"; } # Service worker and manifest must always be revalidated. location ~ ^/(sw\.js|workbox-.*\.js|registerSW\.js|manifest\.webmanifest|index\.html)$ { add_header Cache-Control "no-cache"; } location / { add_header Cache-Control "no-cache"; try_files $uri /index.html; } }