Files
dify-plus/admin/web/.docker-compose/nginx/conf.d/my.conf
T
2026-02-25 17:08:02 +08:00

29 lines
968 B
Plaintext

server {
listen 8081;
server_name localhost;
absolute_redirect off; # 使用相对重定向,避免暴露后端端口导致浏览器跳转到 :8080
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/share/nginx/html;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
#rewrite ^/admin/(.*)$ /$1 break;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_set_header Host $http_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 $scheme;
rewrite ^/api/(.*)$ /$1 break; #重写
proxy_pass http://admin-server:8888; # 设置代理服务器的协议和地址
}
location /api/swagger/index.html {
proxy_pass http://127.0.0.1:8888/swagger/index.html;
}
}