wordpress-nginx-main/sites-available/multiple-vhosts.conf
hhftechnologies dd82b3e56c update
2024-09-28 17:48:20 +05:30

31 lines
1 KiB
Text

# TODO:
# blog post explaining how it could be incorporated and useful, pros and cons of this setup
server {
listen 80;
server_name *.example.com example.net example.org;
# keep the files in the following way...
# site1.example.com at /path/to/sites/site1.example.com/public
# site2.example.com at /path/to/sites/site2.example.com/public
# site3.example.com at /path/to/sites/site3.example.com/public
# example.net at /path/to/sites/example.net/public
# example.org at /path/to/sites/example.org/public
root /path/to/sites/$host/public;
index index.php index.html;
# Let's have a common log for all the sites
# individual logs are not possible to create for each site
access_log /var/log/nginx/common-vhost-access.log combined buffer=64k flush=5m if=$loggable;
error_log /var/log/nginx/common-vhost-error.log error;
include "globals/restrictions.conf";
include "globals/assets.conf";
include "globals/php.conf";
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
}