首页 > 代码库 > nginx解决浏览器访问http自动转向https问题
nginx解决浏览器访问http自动转向https问题
nginx配置文件如下:
server { listen 443 ssl http2; server_name zt.test.com; ssl on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ‘AES128+EECDH:AES128+EDH:!aNULL‘; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_dhparam /etc/nginx/conf.d/ssl/dhparam.pem; ssl_certificate /etc/nginx/conf.d/ssl/test.com.crt; ssl_certificate_key /etc/nginx/conf.d/ssl/test.com.key; #把下面的注释掉就可以了 #add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; access_log /var/log/nginx/zt.test.log main; set $web_url $host; location / { proxy_pass http://staticweb.server; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; set $domain default; } }
nginx解决浏览器访问http自动转向https问题
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。