您在这里: Wiki » notes » n » nginx http转https 301跳转

nginx http转https 301跳转

nginx http转https 301跳转

    server {
        listen    80;
        listen    [::]:80;
        server_name     _;

        access_log off;
        return 301 https://$host$request_uri;
    }

其中 _ 表示匹配所有未明确定义的主机名。

notes/n/nginx_ssl_redirect.txt · 最后更改: 2023/04/20 07:59