feat: 實作 Demo 環境網域路由轉發,設定 ERP Proxy 統一接管 Port 80
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
services:
|
||||
proxy:
|
||||
ports:
|
||||
- '8080:80'
|
||||
- '80:80'
|
||||
- '8080:8080'
|
||||
volumes:
|
||||
- './nginx/demo-proxy.conf:/etc/nginx/conf.d/default.conf:ro'
|
||||
|
||||
@@ -74,6 +74,8 @@ services:
|
||||
proxy:
|
||||
image: 'nginx:alpine'
|
||||
container_name: star-erp-proxy
|
||||
extra_hosts:
|
||||
- 'host.docker.internal:host-gateway'
|
||||
networks:
|
||||
- sail
|
||||
depends_on:
|
||||
|
||||
@@ -20,3 +20,21 @@ server {
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
}
|
||||
}
|
||||
|
||||
# Gitea 服務 - 透過主機 Port 3000 轉發
|
||||
server {
|
||||
listen 80;
|
||||
server_name gitea.taiwan-star.com.tw;
|
||||
|
||||
# 允許上傳大檔案 (git push)
|
||||
client_max_body_size 512M;
|
||||
|
||||
location / {
|
||||
proxy_pass http://host.docker.internal:3000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user