Created
November 12, 2018 04:46
-
-
Save tag1216/3dd09c0fddea8d28b18a580c18adbedb to your computer and use it in GitHub Desktop.
front-backend用nginx設定
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
server { | |
listen 8081 default; | |
server_name localhost 127.0.0.1; | |
location /api/v1/ { | |
proxy_pass http://localhost:8082/; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
} | |
location / { | |
proxy_pass http://localhost:8083; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
# try_files $uri /index.html; | |
} | |
} |
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
version: "3" | |
services: | |
nginx: | |
restart: always | |
image: nginx | |
volumes: | |
- ./etc/nginx/conf.d/:/etc/nginx/conf.d/:ro | |
network_mode: "host" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment