[英]nginx proxy from 80 to 444 same IP
I have some webs that are served by nginx with SSL (443) without problems. 我有一些使用SSL(443)的Nginx服务的网站,而没有出现问题。
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. 现在,我的Web邮件在端口444上提供SSL服务,但是我希望nginx在webmail.mydomain.com到达时从80代理到444。
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;
}
} }
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 显然我的港口不一样
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.