Av资源站 中文字幕_九九亚洲精品性爱视频_丁香五月开心婷婷综合中文_2021国产成人精品无码

101
Nginx自動跳轉(zhuǎn)到HTTPS

修改Nginx配置文件

示例一

rewrite ^(.*)$ https://$host$1 permanent;

示例二

適用于 80端口和443 配置在同一個 server{}內(nèi)

if ($server_port = 80) {
rewrite ^(.*)$ https://$host$1 permanent;
}

示例三 站點綁定很多域名,只讓某個域名跳轉(zhuǎn):

set $redirect_https 1;
if ($server_port = 80) {
set $redirect_https "${redirect_https}2";
}
if ($http_host = 'www.exampledemo.com') {
set $redirect_https "${redirect_https}3";
}
if ($http_host = 'exampledemo.com') {
set $redirect_https "${redirect_https}3";
}
if ($redirect_https = "123") {
rewrite ^(.*)$ https://$host$1 permanent;
}

配置示例 配置示例:

server {
listen 80;
server_name www.exampledemo.cn;
rewrite ^ https://$http_host$request_uri? permanent;
}
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/cacert.pem;
ssl_certificate_key /etc/ssl/privkey.pem;
server_name www.exampledemo.cn;
server_tokens off;
location / {
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;
}
}

這條幫助是否解決了您的問題? 已解決 未解決

提交成功!非常感謝您的反饋,我們會繼續(xù)努力做到更好! 很抱歉未能解決您的疑問。我們已收到您的反饋意見,同時會及時作出反饋處理!

https://s19.#/z_stat.php?id=1261961198&web_id=1261961198