server { listen 80; location / { root /app; try_files $uri /index.html; } location /api { rewrite /api(.*) $1 break; proxy_pass http://backend; } }