# 网站运维

# 如何为网站强制增加 www

Nginx 参考配置

server {
    listen 80;
    server_name modstart.com;
    location / {
        rewrite ^/(.*)$ http://www.modstart.com/$1 permanent;
    }
}
1
2
3
4
5
6
7

# 网站如何强制跳转为 https

Nginx 参考配置

server {
    listen 80;
    server_name www.modstart.com;
    location / {
        rewrite ^/(.*)$ https://www.modstart.com/$1 permanent;
    }
}
1
2
3
4
5
6
7
Last Updated: a month ago