Answer the question
In order to leave comments, you need to log in
NGINX Automatic creation of subdomains?
Trying to migrate to NGINX. I need all folders created in the root of the domain to be subdomains, except for the main /htdocs of course...
The directory structure is:
/var/www/ustim.ru/htdocs
/var/www/ustim.ru/forum
Basically domain, we go to the htdocs directory. All subdomains are in the ustim.ru folder, one is already there /forum
There is still a simple domain config
server {
listen 80 default;
server_name ustim.ru;
root /var/www/ustim.ru/htdocs;
include /etc/nginx/templates/php-fpm.conf;
index index.html index.htm index.php;
access_log /var/log/nginx/ustim.ru_access.log;
error_log /var/log/nginx/ustim.ru_error.log;
}
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName ustim.ru
ServerAlias www.ustim.ru
DocumentRoot /var/www/ustim.ru/htdocs
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName ustim.ru
ServerAlias *.ustim.ru
UseCanonicalName Off
VirtualDocumentRoot /var/www/ustim.ru/%-3
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question