0
我使用的是nginx的負載均衡HTTP和我想我所有的要求,從HTTPS重定向到http。我如何重定向HTTPS對Nginx的負載平衡器
這裏是負載均衡配置的樣子 -
upstream web_app_backend {
ip_hash;
server app1.example.com;
server app2.example.com;
}
server {
listen 443 ssl;
server_name example.com;
ssl_certificate /etc/nginx/ssl/example.crt;
ssl_certificate_key /etc/nginx/ssl/example.com.key;
return 302 http://example.com$request_uri;
}
server {
listen 80;
server_name example.com;
location/{
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
proxy_pass http://web_app_backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}