我根据http://support.ajenti.org/topic/349870-ajenti-behind-nginx/的指引为Ajenti
设置了一个服务器块。
location /ajenti {
rewrite (/ajenti)$ / break;
rewrite /ajenti/(.*) /$1 break;
proxy_pass http://127.0.0.1:8000;
proxy_redirect / /ajenti/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
这让我想到了登录,但是在我登录后,
Ajenti
重定向到 "/ajenti:auth" 而不是 "/ajenti/ajenti:auth"。例如:浏览器 -> HTTPS -> Nginx -> HTTP -> Ajenti
这似乎也是 "ajenti:static" 资源的一个问题。
请参见:http://support.ajenti.org/topic/88086-support-ajenti-behind-a-reverse-proxy/ 在
Nginx
中处理这个问题的推荐方法是什么?
proxy_set_header Origin http://$host;
- theJustinWalsh