我从GitHub克隆后使用docker-compose安装了AWX。我试图从nginx后面运行Ansible awx作为反向代理,但在网页上,输入登录凭据后,它将自己重定向到/api/login/,并显示错误为405不允许查看图片中的错误
你能告诉我我做得对吗?
location /awx/ {
proxy_pass "http://backendawx/";
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-Host $server_name;
proxy_redirect /awx/ //;
access_log /var/log/nginx/awx/access.log timed_combined;
error_log /var/log/nginx/awx/error.log error;
请做下面的nginx配置像。
nginx配置:
upstream backendawx {
server HOSTNAME:PORTNUMBER;
}
location /awx/ {
proxy_pass "http://backendawx/#/login/";
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-Host $server_name;
proxy_redirect /awx/ /#/login/;
access_log /var/log/nginx/awx/access.log timed_combined;
error_log /var/log/nginx/awx/error.log error;
}
location /api/ {
proxy_pass "http://backendawx/api/";
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-Host $server_name;
} ```