nginx: Serve a single-page app
A short, tested nginx example for serve a single-page app. Copy it and adjust the names and paths for your project.
nginx
server {
listen 80;
root /var/www/app;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}Find it in Zest
Search for “nginx serve a single-page app” in Zest and this example appears above the results, with other matches to choose from. Searches stay private.