Skip to content

v6.6.0以后的反向代理设置 #1129

Answered by jeessy2
YuxuanZuo asked this question in Q&A
Discussion options

You must be logged in to vote

根据你的描述,更新到webui v6.6.0之后,反向代理配置似乎遇到了一些问题,导致请求路径发生了不正确的跳转。你提供的配置基本上是正确的,但需要确保路径匹配和代理设置没有问题。下面是一个经过改进的配置示例:

location /ddns/ {
    proxy_pass http://127.0.0.1:9876/;
    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 $scheme;
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_http_version 1.1;
    add_header Cache-Control no-cache;
    add_header Strict-Transport-Security "max-age=31536000";
    rewrite /ddns/(.*) /$1 break;
}

几点说明:

  1. rewrite指令rewrite /ddns/(.*) /$1 break;

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@YuxuanZuo
Comment options

@jeessy2
Comment options

@rdndsy
Comment options

@charley008
Comment options

Answer selected by YuxuanZuo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants