我正在尝试通过代理传递在 nginx 中执行 auth_request,但我不断收到:
1 auth request unexpected status: 301
这是我的配置:
server {
listen 8080;
server_name localhost;
location /my_location/ {
auth_request /access/auth;
try_files $uri =404;
}
location /access/auth/{
proxy_pass http://localhost:5029/server_alias/web_service_name;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
该请求应发送到正在监听端口 5029 的 apache 服务器。
我究竟做错了什么 ?
最佳答案
我为面临同样问题的任何人找到了答案 auth_request 路径中只缺少一个反斜杠。
location /my_location/ {
auth_request /access/auth/;
try_files $uri =404;
}
关于apache - NGINX proxy_pass 到另一个端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33914218/