ksweb 搭建的网站如何在配置文件里将 http 强制跳转至 https 啊? 服务器为 nginx 。 一名小白,在网络上试了很多办法都不行。
ksweb 搭建的网站如何在配置文件里将 http 强制跳转至 https 啊? 服务器为 nginx 。 一名小白,在网络上试了很多办法都不行。
1
itechify PRO nginx 配置跳转,有手就行
|
2
JasonQii May 4, 2024
服务器为 nginx :orz
link -> https://www.cnblogs.com/sexintercourse/p/17189258.html |
3
JasonQii May 4, 2024
然后 配置文件里面加 return 301 https://xxx.xx.xxx;
|
4
isAK47 May 4, 2024
server {
...... ...... ...... if ($host ~ '^baidu.com'){ return 301 https://www.baidu.com$request_uri; } if ($server_port !~ 443){ rewrite ^(/.*)$ https://$host$1 permanent; } ...... ...... ...... } |