nginx反向代理 强制https请求
upstream emove_pools { server 10.1.27.198:8020; check interval=3000 rise=2 fall=3 timeout=2000; } #强制使用https跳转 server { listen 80; server_name test.ok.com; return 301 https://$server_name$request_uri; location / { proxy_pass http://name_pools; } } # server { #listen 80; listen 443; server_name test.ok.com; access_log /data1/logs/nginx/test.ok.com/access.log; ssl on; ssl_certificate /etc/cert/xxxxx023.pem; ssl_certificate_key /etc/cert/xxxxx023.key; ssl_session_cache shared:SSL:1m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; location / { proxy_pass http://name_pools; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
联系方式QQ:326528263 EMAIL:clnking@163.com 网名:bass 分享技术 突破难点 创新思维