C
C
chelkaz2016-03-17 11:09:35
Nginx
chelkaz, 2016-03-17 11:09:35

Why does every subdomain lead to one directory?

There is one server.
All nginx configs are:
server {
listen 80;
server_name dev.site.ru;
access_log /var/log/nginx/dev.access.log;
location ~* \.(css|js|gif|png|jpg|jpeg|ico|ogg|ttf|woff|woff2|eot|otf)$ {
error_page 404 /404.html;
root /var/www/dev/public;
expires 10d;
}
location ~* ^/(images|fonts) {
expires 30d;
}
location / {
proxy_pass 127.0.0.1:8080/;
proxy_redirect off;
log_not_found off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
client_max_body_size 3m;
}
Apache:
ServerName dev.site.ru
DirectoryIndex index.php
DocumentRoot /var/www/dev/public ServerAdmin
[email protected]
CustomLog /var/log/httpd/dev.access.log combined
ErrorLog /var/log/httpd /dev.error.log
AllowOverride All
Options +Includes
AllowOverride none
AddType text/plain php,php3,php4,php5,php6,phtml,pl,asp,aspx,cgi,dll,exe,ico,shtm,shtml,fcg,fcgi ,fpl,asmx,pht
php_value engine off
And there are several such subdomains.
But if you enter the site address for example fgdg.site.ru, then I will apply exactly to the subdomain dev.site.ru
Why is that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Chudnovsky, 2016-03-17
@Frankenstine

Because there is a default site that processes all requests that are not processed by other sites.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question