server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; location = /sw.js { add_header Cache-Control "no-cache, no-store, must-revalidate"; try_files /sw.js =404; } location = /index.html { add_header Cache-Control "no-cache, no-store, must-revalidate"; try_files /index.html =404; } location /assets/ { add_header Cache-Control "public, max-age=31536000, immutable"; try_files $uri =404; } location ^~ /auth { proxy_pass http://api:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location ^~ /admin { if ($http_accept ~* "text/html") { rewrite ^ /index.html last; } proxy_pass http://api:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location ^~ /books { proxy_pass http://api:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location ^~ /progress { proxy_pass http://api:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location /healthz { proxy_pass http://api:3000/healthz; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location / { try_files $uri $uri/ /index.html; } }