内容简介:下面的这个配置,最后验证是可以的。只是没有跳转下面这个跳转成功了
下面的这个配置,最后验证是可以的。只是没有跳转
server { listen 80; listen 443 ssl; #ssl on; server_name hc-explorer.h.cash; ssl_certificate /etc/nginx/cert/7d97acd273b4a22.crt; ssl_certificate_key /etc/nginx/cert/key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect off; proxy_pass http://localhost:7789; } }
下面这个跳转成功了
server{ listen 80; server_name hc-explorer.h.cash; rewrite ^ https://$http_host$request_uri? permanent; } server { listen 443 ssl; #ssl on; server_name hc-explorer.h.cash; ssl_certificate /etc/nginx/cert/7d97acd273b4a22.crt; ssl_certificate_key /etc/nginx/cert/key; #ssl_session_timeout 5m; #ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #ssl_prefer_server_ciphers on; location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect off; proxy_pass http://localhost:7789; } }
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。