Skip to content

Instantly share code, notes, and snippets.

@FreeFly19
Forked from Nata01/default
Last active March 31, 2018 23:16
Show Gist options
  • Save FreeFly19/54fddf4321bca0fab82d95c9e58f6714 to your computer and use it in GitHub Desktop.
Save FreeFly19/54fddf4321bca0fab82d95c9e58f6714 to your computer and use it in GitHub Desktop.
nginx config for backend API and frontend SPA
# File path: /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
root /home/ubuntu/ProjectBravo/smartschool/dist;
location /api {
proxy_redirect off;
proxy_pass http://localhost:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Authorization $http_authorization;
}
location / {
try_files $uri /index.html;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment