我正在尝试将代理重定向到子目录(rails应用)
server {
server_name b2b.demo.juju.com;
access_log /home/tusker/hobgoblin/current/log/b2b_nginx.access.log;
error_log /home/tusker/hobgoblin/current/log/b2b_nginx.error.log info;
client_max_body_size 200M;
client_body_buffer_size 128k;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host demo.juju.com;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Tusker-Admin true;
proxy_set_header X-Request-Start "t=${msec}";
proxy_pass https://demo.juju.com/b2b;
proxy_redirect off;
}
}
我遇到的麻烦是,如果我访问b2b.demo.juju.com,一切都很好,但是如果我单击站点内的链接,该怎么办?它将b2b添加回去。我认为Rails应用会将/ b2b从链接添加回URL。
有没有办法在没有/ b2b的情况下继续重写url?
谢谢