Getting some errors
@lvalics
I tried using the tutorial on your website to set this up:
http://www.grafxsoftware.com/faq.php/HOW-TO-configure-PLESK-with-NGinx-proxy-reverse/1/1/
When i try to test my configuration i get the following error:
"proxy_rewrite_location default" must go after the "proxy_pass" directive in /etc/nginx/proxy.conf:1
I tried to google it but a get a bunch of russian websites but did not find any solution. Does anyone know a solution to this.
I tried to add the entry
proxy_rewrite_location default; to the proxy.conf file but with no succes. I dont see any proxy_pass value either so i have no clue what they are talking about.
Thanks in advance
Edit 1
I have managed to fix the problem i guess, i don't know if it is good. I have changed the following value.
- proxy_redirect default;
+ proxy_redirect off;
So i changed the value from default to off. Is this good or did i just turn off the whole thing.
That said i did stumble upon another another issue. I got the following message after doing the test again:
open() "/etc/nginx/webmail.conf" failed (2: No such file or directory) in /etc/nginx/nginx.conf:55
Now i google a bit and found the following code:
server {
listen 80;
server_name webmail.* ;
access_log /var/log/nginx/webmail/access.log;
location / {
proxy_pass
http://mail1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
}
}
When i run this i stumbled uppon numerous erros:
- invalid parameter "false", use "off" instead in /etc/nginx/webmail.conf:10
- to solve this i changed the proxy_redirect value to either off or default, both work
- host not found in upstream "mail1" in /etc/nginx/webmail.conf:6
- to solve this i just put in one of my domains that usses webmail,
http://webmail.mydomain.com. Not a verry
good solution to this in my opinion, but i just want to start already.
- open() "/var/log/nginx/webmail/access.log" failed (2: No such file or directory)
- created that
After all that i finnaly get:
the configuration file /etc/nginx/nginx.conf syntax is ok
But i do thing I just turned the whole thing off by setting
proxy_redirect off;
When i try to put it back to default it still gives me the same error as before.