标签:_for pre http lis oca server eal crt proxy
nginx 80和443同时做负载均衡:upstream bugqa.ming.com {
server 10.0.0.3:80;
server 10.0.0.4:80;
}
server {
listen 80;
location / {
proxy_pass http://bugqa.ming.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
server {
listen 443;
ssl on;
ssl_certificate ming.com/ming.crt;
ssl_certificate_key ming.com/ming.key;
location / {
proxy_pass http://bugqa.ming.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
:wq
验证:
浏览器访问http://bugqa.ming.com 和 https://bugqa.ming.com
标签:_for pre http lis oca server eal crt proxy
原文地址:http://blog.51cto.com/yangzhiming/2156469