1
私はNginx
の "default" vhost
として次のようなものを使用しています。すべてのサブドメインには基本的に独自のディレクトリが必要です。Nginxワイルドカードルートのサブドメインからのフォールバック
誰でもフォールバックを助けることができます(これは初めてです)。ディレクトリ/サブドメインが存在しない場合は、カスタムのある種の404.html
ページが必要です。
ありがとうございます!
server {
server_name ~^(.+).mysite.com$;
set $root_path $1;
root /var/www/$root_path/public;
index index.html index.php;
location/{
try_files $uri /$uri /index.php?$args;
}
location ~ \.php$ {
#Include Nginx’s fastcgi configuration
include /etc/nginx/fastcgi.conf;
#Look for the FastCGI Process Manager at this location
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
client_max_body_size 100m;
}
}