Thursday, August 22, 2019

Nginx如何实现http跳转到https

Nginx服务器

在配置80端口的文件中,添加以下代码:

server {

listen 80;

server_name localhost;

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

location / {

root html;

index index.html index.htm;

}

No comments:

Post a Comment