update nginx proxypass

This commit is contained in:
LittleBoy 2024-06-24 10:24:59 +08:00
parent 76c3d57f55
commit a4e21ec909
2 changed files with 6 additions and 2 deletions

View File

@ -29,7 +29,7 @@ FROM nginx:1.26-alpine3.19 AS runner
WORKDIR /app
# envs 配置
ENV APP_API_URL http://localhost:50000
ENV APP_API_URL localhost:50000
# nginx配置文件
COPY nginx.conf /etc/nginx/conf.d/default.conf.template

View File

@ -1,3 +1,7 @@
upstream payment_backend {
server $APP_API_URL;
}
server {
listen 80;
listen [::]:80;
@ -22,7 +26,7 @@ server {
}
location ^~/api {
proxy_pass $APP_API_URL;
proxy_pass http://payment_backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;