我有几个服务器块彼此不能很好用,我想从.well-known/
文件夹提供文件,但是当它们不是来自{https
时,也会重定向到.well-known/
1}}文件夹
如何制作一个重定向的服务器块,还可以提供一些文件?
/ BLOCK1启用位点-
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html;
server_name _;
location ~ /.well-known {
allow all;
}
location / {
try_files $uri $uri/ =404;
}
}
/ BLOCK2启用位点-
server {
listen 80;
listen [::]:80;
server_name www.example.com;
return 301 https://example.com$request_uri;
}
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com cdn.example.com subdomain.example.com;
return 301 https://$host$request_uri;
}