Skip to content

Instantly share code, notes, and snippets.

@tag1216
Created November 12, 2018 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tag1216/3dd09c0fddea8d28b18a580c18adbedb to your computer and use it in GitHub Desktop.
Save tag1216/3dd09c0fddea8d28b18a580c18adbedb to your computer and use it in GitHub Desktop.
front-backend用nginx設定
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;
}
}
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