upstream api { server 127.0.0.1:8080; } server { listen 0.0.0.0:80; root /path/to/pool/www/dist; index index.html index.htm; server_name localhost; location /api { proxy_pass http://api; } location / { try_files $uri $uri/ /index.html; } }