- / = domain.com (Front-end app)
- /admin = domain.com/admin (Front-end app)
- /api = domain.com/api (Node.js, running on 3000 port)
Last active
February 9, 2022 08:03
-
-
Save ozgurg/a64de4672c60b13dbed8888731056417 to your computer and use it in GitHub Desktop.
NGINX: Separating client, API, admin (Node.js & React/Vue/etc)
This file contains 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
server { | |
listen 80; | |
listen [::]:80; | |
server_name localhost; | |
index index.html; | |
root /var/www/client; | |
location / { | |
try_files $uri /index.html; | |
} | |
location /admin { | |
root /var/www; | |
try_files $uri /admin/index.html; | |
} | |
location ^~ /api/ { | |
proxy_pass http://127.0.0.1:3000/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment