Last active
August 25, 2016 08:18
-
-
Save Matrixbirds/84b806616f538f4df7d52e1ffe4dd608 to your computer and use it in GitHub Desktop.
A simple SPA Nginx demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## try_files all request except /api, /admin/api | |
upstream backend_api { | |
server ip_address; | |
} | |
server { | |
listen 80; | |
server_name t66y.domain.com; | |
index index.html; | |
charset utf-8; | |
location /index.html { | |
proxy_pass http://backend_api; | |
proxy_redirect off; | |
} | |
location / { | |
try_files $uri $uri/ /index.html; | |
} | |
location ~ ^/(api|admin/api)/ { | |
proxy_pass http://backend_api; | |
proxy_redirect off; | |
} | |
location /admin/api { | |
proxy_pass http://backend_api; | |
proxy_redirect off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment