I see a lot of examples of nginx.conf using a reverse proxy similar to this:
location / {
proxy_pass frontend;
}
location /api/ {
proxy_pass backend;
}
But why not serve the frontend as static files similar to this?
location / {
root /usr/share/nginx/html;
try_files $uri /index.html;
}
location /api/ {
proxy_pass backend;
}