rewrite 重写URL实现
server {
listen 80;
server_name localhost;
rewrite ^(.*)$ https://$host$1 permanent;
}
301 重定向实现
server {
listen 80;
server_name *.codelinux.cn;
return 301 https://$http_host$request_uri;
}
个人点滴记录
rewrite 重写URL实现
server {
listen 80;
server_name localhost;
rewrite ^(.*)$ https://$host$1 permanent;
}
301 重定向实现
server {
listen 80;
server_name *.codelinux.cn;
return 301 https://$http_host$request_uri;
}