This commit is contained in:
Administrator
2024-05-15 16:59:06 +08:00
parent aa9c385330
commit ae1ddd6d73
2 changed files with 4 additions and 2 deletions

View File

@@ -63,6 +63,8 @@ services:
volumes: volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./vue/html1:/var/www/html - ./vue/html1:/var/www/html
networks:
- mynetwork
-
networks: networks:
mynetwork: mynetwork:

View File

@@ -11,7 +11,7 @@ server {
# API转发 # API转发
location /api { location /api {
rewrite ^/api(.*)$ $1 break; rewrite ^/api(.*)$ $1 break;
proxy_pass http://127.0.0.1:9100; # 将 /api 的请求转发到 http://127.0.0.1:9100 proxy_pass http://127.0.0.1:9100;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;