tags:

views:

29

answers:

1

Hi,

I have some webs that are served by nginx with SSL (443) without problems.

Now, I have the web mail serving SSL on port 444, but I want nginx to proxy from 80 to 444 when webmail.mydomain.com reaches.

I've tried some config but no one of them worked. This is the last one ...

thanks,

m.

server {
    listen 80;


    server_name webmail.mydomain.com;
    root /etc/nginx/sites-available/webmail/;
    access_log /etc/nginx/sites-available/nginx.log;
    client_max_body_size 50M;


    location / {

                    proxy_pass http://192.168.1.2:444/;
                    proxy_redirect https://192.168.1.2:444;
            }

}

A: 

I'm doing something similar. What worked for me was to define an upstream server on the same box

upstream some_name {
    server 127.0.0.1:4000;
}

and then doing

proxy pass http://some_name;

Obviously my ports are different

Chris McCauley
If I use your suggestion, and only the proxy_pass proxy_pass https://some_name;I can get the correct page, but all the links doesn't work properly.
mongeta
Ok, sorry I couldn't help further :-(
Chris McCauley
but thanks to you I can go where I want, with bad links but it's a starting point! thanks!
mongeta