Nginx服务器
在配置80端口的文件里面写入以下内容,重启Nginx即可生效。
server { listen 80; server_name localhost; rewrite ^(.*)$ https://$host$1 permanent; #老版Nginx的rewrite重定向方法 #return 301 https://$server_name$request_uri; #新版Nginx推荐无条件301跳转方法 location / { root html; index index.html index.htm; } }继续阅读“网站http强制跳转https方法”