server { listen 80; root /usr/share/nginx/html; index index.html; # Proxy /api to the backend location /api/ { proxy_pass http://pagemanager.api:8080/api/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } # SPA fallback — all other routes serve index.html location / { try_files $uri $uri/ /index.html; } }