35 lines
1.4 KiB
Nginx Configuration File
35 lines
1.4 KiB
Nginx Configuration File
http {
|
||
|
||
upstream service {
|
||
server 192.168.56.101:48080;
|
||
server 192.168.56.102:48080;
|
||
}
|
||
|
||
server {
|
||
listen 48088;
|
||
server_name 192.168.56.103; ## 重要!!!修改成你的外网 IP/域名
|
||
location / { ## 前端项目
|
||
root /usr/share/nginx/html/admin-ui;
|
||
index index.html index.htm;
|
||
try_files $uri $uri/ /index.html;
|
||
error_page 405 =200 $request_uri;
|
||
}
|
||
location /admin-api/ { ## 后端项目 - 管理后台
|
||
proxy_pass http://service/admin-api/; ## 重要!!!proxy_pass 需要设置为后端项目所在服务器的 IP
|
||
proxy_set_header Host $http_host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header REMOTE-HOST $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
}
|
||
location /app-api/ { ## 后端项目 - 用户 App
|
||
proxy_pass http://service/app-api/; ## 重要!!!proxy_pass 需要设置为后端项目所在服务器的 IP
|
||
proxy_set_header Host $http_host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header REMOTE-HOST $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
}
|
||
}
|
||
}
|
||
|
||
|