我正在使用nginx,我想出了如何将http://[IP地址重定向到我的域名,但我不能让https工作。我试过了:
server {
listen 443;
server_name 31.220.108.250;
return 301 https://mosachi.ga$request_uri;
}但它不起作用。
发布于 2020-12-18 19:23:09
我想重定向所有不同的urls,如下所示:
添加到https://example.com,所以我使用了类似这样的东西:
server {
listen 80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}
server {
listen 443 ssl;
if ($host != "example.com") {
return 301 https://example.com$request_uri;
}
ssl_certificate /ssl/example.pem;
ssl_certificate_key /ssl/example.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
....https://stackoverflow.com/questions/65314265
复制相似问题