Strange nginx redirects without trailing slash
Hi ppl ;)
I am trying to setup nginx as a proxy for apache2, but faced strange problem. I have test site http://c-craft.info and have installed roundcube in /roundcube subdirectory. So here is the problem: If you will try to open http://c-craft.info/roundcube you will get strange redirect back to your own IP address. But if you will add trailing slash to uri http://c-craft.info/roundcube/ it will work. 1. Why does it happen? How to fix it. 2. Should I use regex to force adding trailing slash? Quote:
nginx.conf Quote:
Quote:
Quote:
Quote:
Quote:
|
Hi,
I'm not very familiar with nginx reverse proxy config, but if it works like apache, you have to add a trailing slash at the proxied URL like this: Code:
proxy_pass http://8*.***.**.**6:9091/ ; |
Hi! Nope, it did not help...
Forgot to say, that access through apache works normal http://c-craft.info:9091/roundcube |
Quote:
You maybe have to check apache vhosts |
Quote:
|
Hi,
Maybe not what you want, but check if the following works: Code:
location /roundcube/ { |
Quote:
Update: Ok, I think I found the problem. For some reason $_SERVER["HTTP_HOST"] is incorrect - it is getting equal to $remote_addr, but not always... this is weird. I am trying to understand how does this happen, is it nginx, apache or PHP problem? Update 2: So this sounds like nginx problem... you can check two test addresses: http://contra.lv/server.php and http://contra.lv:9091/server.php. You can see, that HTTP_POST is different on nginx and apache... |
Quote:
Code:
proxy_redirect off; |
Quote:
Quote:
Something still not right in my server configuration... Interesting thing is, that when I add $host to nginx log_format I see there normal host, but it is not forwarded as $host to apache for some reason. And the problem with trailing slash still exists: http://c-craft.info/roundcube still redirects back to $remote_addr. :( |
Quote:
|
Quote:
|
Quote:
Regards |
All times are GMT -5. The time now is 04:20 AM. |