map $http_cookie $moku_bootstrap_document { default /__loader/index.html; "~*(^|; )moku_loader_seen=1($|;)" /index.html; } server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; location = / { add_header Cache-Control "no-store"; rewrite ^ $moku_bootstrap_document last; } location ^~ /__loader/ { access_log off; add_header Cache-Control "no-store"; try_files $uri =404; } location / { try_files $uri $uri/ $moku_bootstrap_document; } location ^~ /v1/ { proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://api:8081; } location /favicon.ico { try_files $uri =404; access_log off; log_not_found off; } location /_build/ { access_log off; add_header Cache-Control "public, max-age=31536000, immutable"; try_files $uri =404; } }