如果主站点url正在使用SSL,那么可以排除所有其他子域被加密吗?
server {
listen 80;
listen [::]:80;
server_name .example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
## ssl stuff
server_name www.example.com;
return 301 https://example.com$request_uri;
}
server {
listen 443 ssl default_server http2;
listen [::]:443 ssl http2;
server_name example.com;
root /home/forge/example.com/public;
index index.html index.htm index.php;
charset utf-8;
}发布于 2018-04-25 21:35:04
定义一个更具体的服务器,它将用于替代您拥有的服务器。
server {
listen 80;
server_name subdomain1.example.com; # add others if you like
root /home/forge/example.com/public/subdomain; # check this
index index.html index.htm index.php;
}正如ceejay在注释中所指出的,在您所包含的配置中没有包含重定向,所以其他的事情正在发生。
为了对其进行汇总,将提供更具体的server\_name,因此不会进行301重定向。从..。
https://serverfault.com/questions/909479
复制相似问题