简体   繁体   English

Nginx重定向到https

[英]Nginx redirect to https

THis is the block i need to redirect to https : 这是我需要重定向到https的块:

location / {
            try_files $uri $uri/ index.html?$query_string;
}

Is there any way to simply forward this to https ? 有什么方法可以将其简单地转发到https吗?

server {
    server_name                 example.com;
    location / {
        rewrite                 ^(.*)$  https://example.com$1  permanent;
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM