Linux 将除一个子域以外的所有子域重定向到https?
该职位是非常接近我所寻找的。但我要找的是Linux 将除一个子域以外的所有子域重定向到https?,linux,redirect,nginx,https,lets-encrypt,Linux,Redirect,Nginx,Https,Lets Encrypt,该职位是非常接近我所寻找的。但我要找的是 letsencrypt.example.com should always be http *.example.com should always be https 使用post中的解决方案,我可以通过以下方式将所有http重写为https server { listen 80; server_name test.example.com; rewrite ^ https://$http_host$re
letsencrypt.example.com should always be http
*.example.com should always be https
使用post中的解决方案,我可以通过以下方式将所有http重写为https
server {
listen 80;
server_name test.example.com;
rewrite ^ https://$http_host$request_uri? permanent;
}
然后再往前走
server {
listen 443 ssl;
...
问题
但是如何确保
letsencrypt.example.com
保留在http端口80?您应该为letsencrypt.example.com
使用一个显式服务器,然后使用一个全包服务器进行重定向
您的端口80服务器块如下所示:
server {
listen 80;
server_name letsencrypt.example.com;
...
}
server {
listen 80 default_server;
return 301 https://$http_host$request_uri;
}
有关详细信息,请参阅