Nginx configuration is catching all subdomains without a wildcard, how to fix?Help needed setting up nginx to serve static filesBlank Page: wordpress on nginx+php-fpmNginx gives 504 Gateway Time-out once moved to livePHP app breaks on Nginx, but works on ApacheNGINX don't parse .php5 as .phpnginx rewrite throw 404 with last and breakNginX + WordPress + SSL + non-www + W3TC vhost config file questions403 Forbidden nginx (nginx/1.8.0)nginx configuration troubleCodeIgniter nginx rewrite rules for i8ln URL's
How do credit card companies know what type of business I'm paying for?
Definition of 'vrit'
If the mass of the Earth is decreasing by sending debris in space, does its angular momentum also decrease?
cannot access to my session
Time at 1G acceleration to travel 100 000 light years
Does knowing the surface area of all faces uniquely determine a tetrahedron?
Fantasy game inventory — Ch. 5 Automate the Boring Stuff
Simple python RFID (RC522) authentication system not working
I have found ports on my Samsung smart tv running a display service. What can I do with it?
What is this airplane that sits in front of Barringer High School in Newark, NJ?
How to address players struggling with simple controls?
Do details of my undergraduate title matter?
Are there foreign customs agents on US soil?
Time travel short story where someone from the past follows the travelers back
Is there a polite way to ask about one's ethnicity?
How to write a nice frame challenge?
Are there any individual aliens that have gained superpowers in the Marvel universe?
distance between parabola endpoints
What kind of chart is this?
Explicit song lyrics checker
Got a new frameset, don't know why I need this split ring collar?
Is this a valid proof that A = B given A ∩ B = A ∪ B?
Having some issue with notation in a Hilbert space
Why swap space doesn't get filesystem check at boot time?
Nginx configuration is catching all subdomains without a wildcard, how to fix?
Help needed setting up nginx to serve static filesBlank Page: wordpress on nginx+php-fpmNginx gives 504 Gateway Time-out once moved to livePHP app breaks on Nginx, but works on ApacheNGINX don't parse .php5 as .phpnginx rewrite throw 404 with last and breakNginX + WordPress + SSL + non-www + W3TC vhost config file questions403 Forbidden nginx (nginx/1.8.0)nginx configuration troubleCodeIgniter nginx rewrite rules for i8ln URL's
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
My Nginx config is catching all subdomains without specifying a wildcard. I have created an special config for each subdomain, but seems that all subdomains pass trough the main domain configuration. I have discovered this by removing the subdomains configuration files from nginx.conf and watching how it still catches all the subdomains, so when I send a request to uk.domain.com, instead of Nginx catching the subdomain configuration, goes through the main domain configuration. This is causing trouble with applying mod_pagespeed individually to each of the sites and also managing the GA universal code.
The config for the main domain is this :
server ogv
HHVM config with fallback to fpm :
location ~ .(hh|php)$
proxy_intercept_errors on;
error_page 502 = @fpm;
try_files $uri /index.php;
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
location @fpm
try_files $uri /index.php;
include fastcgi_params;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:8000;
fastcgi_buffers 32 16k;
Wordpress Multisite rewrites :
# Rewrite rules for WordPress Multi-site.
if (!-e $request_filename)
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*.php)$ $1 last;
nginx
|
show 8 more comments
My Nginx config is catching all subdomains without specifying a wildcard. I have created an special config for each subdomain, but seems that all subdomains pass trough the main domain configuration. I have discovered this by removing the subdomains configuration files from nginx.conf and watching how it still catches all the subdomains, so when I send a request to uk.domain.com, instead of Nginx catching the subdomain configuration, goes through the main domain configuration. This is causing trouble with applying mod_pagespeed individually to each of the sites and also managing the GA universal code.
The config for the main domain is this :
server ogv
HHVM config with fallback to fpm :
location ~ .(hh|php)$
proxy_intercept_errors on;
error_page 502 = @fpm;
try_files $uri /index.php;
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
location @fpm
try_files $uri /index.php;
include fastcgi_params;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:8000;
fastcgi_buffers 32 16k;
Wordpress Multisite rewrites :
# Rewrite rules for WordPress Multi-site.
if (!-e $request_filename)
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*.php)$ $1 last;
nginx
Sorry, what do you mean with a "default site config" ? What I do is to create a config file for each subdomain and for the main site ( the one I posted ) and then include each of these on the http config ( nginx.conf in my case )
– xavier
Nov 27 '15 at 12:44
There should be a sites-available and sites-enabled folder. In the sites-available folder should be a config called default. It should be then sym lined to sites-enabled. The idea is that this handles everything you don't have a config specifically for. The sites-enabled folder would be referenced from the nginx.conf file
– Drifter104
Nov 27 '15 at 12:51
1
@xavier It would help if you could post your nginx.conf, and your folder structure under /etc/nginx
– vic
Nov 27 '15 at 12:55
1
I have posted the nginx.conf on an edit. As you can see, I include the other sites configuration the same way I include the main domain config. I have compiled nginx manually so there is no sites-enabled / sites-available, I think that is an Ubuntu / Debian style package implementation.
– xavier
Nov 27 '15 at 13:02
1
@drifter104 that paradigm only holds on debian-based installs of Nginx. By default Nginx does not config like that
– Xyon
Nov 27 '15 at 13:03
|
show 8 more comments
My Nginx config is catching all subdomains without specifying a wildcard. I have created an special config for each subdomain, but seems that all subdomains pass trough the main domain configuration. I have discovered this by removing the subdomains configuration files from nginx.conf and watching how it still catches all the subdomains, so when I send a request to uk.domain.com, instead of Nginx catching the subdomain configuration, goes through the main domain configuration. This is causing trouble with applying mod_pagespeed individually to each of the sites and also managing the GA universal code.
The config for the main domain is this :
server ogv
HHVM config with fallback to fpm :
location ~ .(hh|php)$
proxy_intercept_errors on;
error_page 502 = @fpm;
try_files $uri /index.php;
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
location @fpm
try_files $uri /index.php;
include fastcgi_params;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:8000;
fastcgi_buffers 32 16k;
Wordpress Multisite rewrites :
# Rewrite rules for WordPress Multi-site.
if (!-e $request_filename)
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*.php)$ $1 last;
nginx
My Nginx config is catching all subdomains without specifying a wildcard. I have created an special config for each subdomain, but seems that all subdomains pass trough the main domain configuration. I have discovered this by removing the subdomains configuration files from nginx.conf and watching how it still catches all the subdomains, so when I send a request to uk.domain.com, instead of Nginx catching the subdomain configuration, goes through the main domain configuration. This is causing trouble with applying mod_pagespeed individually to each of the sites and also managing the GA universal code.
The config for the main domain is this :
server ogv
HHVM config with fallback to fpm :
location ~ .(hh|php)$
proxy_intercept_errors on;
error_page 502 = @fpm;
try_files $uri /index.php;
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
location @fpm
try_files $uri /index.php;
include fastcgi_params;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:8000;
fastcgi_buffers 32 16k;
Wordpress Multisite rewrites :
# Rewrite rules for WordPress Multi-site.
if (!-e $request_filename)
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*.php)$ $1 last;
nginx
nginx
edited Nov 30 '15 at 11:25
xavier
asked Nov 27 '15 at 12:27
xavierxavier
1114
1114
Sorry, what do you mean with a "default site config" ? What I do is to create a config file for each subdomain and for the main site ( the one I posted ) and then include each of these on the http config ( nginx.conf in my case )
– xavier
Nov 27 '15 at 12:44
There should be a sites-available and sites-enabled folder. In the sites-available folder should be a config called default. It should be then sym lined to sites-enabled. The idea is that this handles everything you don't have a config specifically for. The sites-enabled folder would be referenced from the nginx.conf file
– Drifter104
Nov 27 '15 at 12:51
1
@xavier It would help if you could post your nginx.conf, and your folder structure under /etc/nginx
– vic
Nov 27 '15 at 12:55
1
I have posted the nginx.conf on an edit. As you can see, I include the other sites configuration the same way I include the main domain config. I have compiled nginx manually so there is no sites-enabled / sites-available, I think that is an Ubuntu / Debian style package implementation.
– xavier
Nov 27 '15 at 13:02
1
@drifter104 that paradigm only holds on debian-based installs of Nginx. By default Nginx does not config like that
– Xyon
Nov 27 '15 at 13:03
|
show 8 more comments
Sorry, what do you mean with a "default site config" ? What I do is to create a config file for each subdomain and for the main site ( the one I posted ) and then include each of these on the http config ( nginx.conf in my case )
– xavier
Nov 27 '15 at 12:44
There should be a sites-available and sites-enabled folder. In the sites-available folder should be a config called default. It should be then sym lined to sites-enabled. The idea is that this handles everything you don't have a config specifically for. The sites-enabled folder would be referenced from the nginx.conf file
– Drifter104
Nov 27 '15 at 12:51
1
@xavier It would help if you could post your nginx.conf, and your folder structure under /etc/nginx
– vic
Nov 27 '15 at 12:55
1
I have posted the nginx.conf on an edit. As you can see, I include the other sites configuration the same way I include the main domain config. I have compiled nginx manually so there is no sites-enabled / sites-available, I think that is an Ubuntu / Debian style package implementation.
– xavier
Nov 27 '15 at 13:02
1
@drifter104 that paradigm only holds on debian-based installs of Nginx. By default Nginx does not config like that
– Xyon
Nov 27 '15 at 13:03
Sorry, what do you mean with a "default site config" ? What I do is to create a config file for each subdomain and for the main site ( the one I posted ) and then include each of these on the http config ( nginx.conf in my case )
– xavier
Nov 27 '15 at 12:44
Sorry, what do you mean with a "default site config" ? What I do is to create a config file for each subdomain and for the main site ( the one I posted ) and then include each of these on the http config ( nginx.conf in my case )
– xavier
Nov 27 '15 at 12:44
There should be a sites-available and sites-enabled folder. In the sites-available folder should be a config called default. It should be then sym lined to sites-enabled. The idea is that this handles everything you don't have a config specifically for. The sites-enabled folder would be referenced from the nginx.conf file
– Drifter104
Nov 27 '15 at 12:51
There should be a sites-available and sites-enabled folder. In the sites-available folder should be a config called default. It should be then sym lined to sites-enabled. The idea is that this handles everything you don't have a config specifically for. The sites-enabled folder would be referenced from the nginx.conf file
– Drifter104
Nov 27 '15 at 12:51
1
1
@xavier It would help if you could post your nginx.conf, and your folder structure under /etc/nginx
– vic
Nov 27 '15 at 12:55
@xavier It would help if you could post your nginx.conf, and your folder structure under /etc/nginx
– vic
Nov 27 '15 at 12:55
1
1
I have posted the nginx.conf on an edit. As you can see, I include the other sites configuration the same way I include the main domain config. I have compiled nginx manually so there is no sites-enabled / sites-available, I think that is an Ubuntu / Debian style package implementation.
– xavier
Nov 27 '15 at 13:02
I have posted the nginx.conf on an edit. As you can see, I include the other sites configuration the same way I include the main domain config. I have compiled nginx manually so there is no sites-enabled / sites-available, I think that is an Ubuntu / Debian style package implementation.
– xavier
Nov 27 '15 at 13:02
1
1
@drifter104 that paradigm only holds on debian-based installs of Nginx. By default Nginx does not config like that
– Xyon
Nov 27 '15 at 13:03
@drifter104 that paradigm only holds on debian-based installs of Nginx. By default Nginx does not config like that
– Xyon
Nov 27 '15 at 13:03
|
show 8 more comments
1 Answer
1
active
oldest
votes
1.) Remove your default config
rm -R /etc/nginx/sites-enabled/*
2.) Move your Configurations into the sites-available folder
mv /etc/nginx/*.comain.com /sites-available
mv /etc/nginx/anotherdomain /sites-available
3.) Link all Configurations in the sites-enabled folder to "enable" them.
ln -s /etc/nginx/sites-available/anyconfig /etc/nginx/sites-enabled/anyconfig
4.) Reload Nginx
service nginx configtest
service nginx reload
Check all your Configuration for the following Parts in the listen directive:
"default_site" and "_"
Both work as an Catch all mechanismus.
Edit nginx.conf
remove all includes and add:
include /etc/nginx/sites-enabled/*
Following this procedur, you have no "Wildcard" Nginx config anymore. To enable "Catch all", just create a new config, or edit a existing config and add "default_server", looks like:
server
listen 80;
listen 443 ssl default_server;
...
BR Bernd
I have compiled nginx manually, there is not sites enabled / sites available directories. After all that only serves the purpose of including or not an specific site configuration.
– xavier
Nov 27 '15 at 14:35
hmm, strange. catch all is normaly just provided through "default_server" or "_". Can you show us: include hhvm.conf; include domain.com-ps.conf; include multisite.conf;
– Berndinox
Nov 27 '15 at 14:40
I have added via edit the config you are asking for.
– xavier
Nov 30 '15 at 11:27
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f739332%2fnginx-configuration-is-catching-all-subdomains-without-a-wildcard-how-to-fix%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
1.) Remove your default config
rm -R /etc/nginx/sites-enabled/*
2.) Move your Configurations into the sites-available folder
mv /etc/nginx/*.comain.com /sites-available
mv /etc/nginx/anotherdomain /sites-available
3.) Link all Configurations in the sites-enabled folder to "enable" them.
ln -s /etc/nginx/sites-available/anyconfig /etc/nginx/sites-enabled/anyconfig
4.) Reload Nginx
service nginx configtest
service nginx reload
Check all your Configuration for the following Parts in the listen directive:
"default_site" and "_"
Both work as an Catch all mechanismus.
Edit nginx.conf
remove all includes and add:
include /etc/nginx/sites-enabled/*
Following this procedur, you have no "Wildcard" Nginx config anymore. To enable "Catch all", just create a new config, or edit a existing config and add "default_server", looks like:
server
listen 80;
listen 443 ssl default_server;
...
BR Bernd
I have compiled nginx manually, there is not sites enabled / sites available directories. After all that only serves the purpose of including or not an specific site configuration.
– xavier
Nov 27 '15 at 14:35
hmm, strange. catch all is normaly just provided through "default_server" or "_". Can you show us: include hhvm.conf; include domain.com-ps.conf; include multisite.conf;
– Berndinox
Nov 27 '15 at 14:40
I have added via edit the config you are asking for.
– xavier
Nov 30 '15 at 11:27
add a comment |
1.) Remove your default config
rm -R /etc/nginx/sites-enabled/*
2.) Move your Configurations into the sites-available folder
mv /etc/nginx/*.comain.com /sites-available
mv /etc/nginx/anotherdomain /sites-available
3.) Link all Configurations in the sites-enabled folder to "enable" them.
ln -s /etc/nginx/sites-available/anyconfig /etc/nginx/sites-enabled/anyconfig
4.) Reload Nginx
service nginx configtest
service nginx reload
Check all your Configuration for the following Parts in the listen directive:
"default_site" and "_"
Both work as an Catch all mechanismus.
Edit nginx.conf
remove all includes and add:
include /etc/nginx/sites-enabled/*
Following this procedur, you have no "Wildcard" Nginx config anymore. To enable "Catch all", just create a new config, or edit a existing config and add "default_server", looks like:
server
listen 80;
listen 443 ssl default_server;
...
BR Bernd
I have compiled nginx manually, there is not sites enabled / sites available directories. After all that only serves the purpose of including or not an specific site configuration.
– xavier
Nov 27 '15 at 14:35
hmm, strange. catch all is normaly just provided through "default_server" or "_". Can you show us: include hhvm.conf; include domain.com-ps.conf; include multisite.conf;
– Berndinox
Nov 27 '15 at 14:40
I have added via edit the config you are asking for.
– xavier
Nov 30 '15 at 11:27
add a comment |
1.) Remove your default config
rm -R /etc/nginx/sites-enabled/*
2.) Move your Configurations into the sites-available folder
mv /etc/nginx/*.comain.com /sites-available
mv /etc/nginx/anotherdomain /sites-available
3.) Link all Configurations in the sites-enabled folder to "enable" them.
ln -s /etc/nginx/sites-available/anyconfig /etc/nginx/sites-enabled/anyconfig
4.) Reload Nginx
service nginx configtest
service nginx reload
Check all your Configuration for the following Parts in the listen directive:
"default_site" and "_"
Both work as an Catch all mechanismus.
Edit nginx.conf
remove all includes and add:
include /etc/nginx/sites-enabled/*
Following this procedur, you have no "Wildcard" Nginx config anymore. To enable "Catch all", just create a new config, or edit a existing config and add "default_server", looks like:
server
listen 80;
listen 443 ssl default_server;
...
BR Bernd
1.) Remove your default config
rm -R /etc/nginx/sites-enabled/*
2.) Move your Configurations into the sites-available folder
mv /etc/nginx/*.comain.com /sites-available
mv /etc/nginx/anotherdomain /sites-available
3.) Link all Configurations in the sites-enabled folder to "enable" them.
ln -s /etc/nginx/sites-available/anyconfig /etc/nginx/sites-enabled/anyconfig
4.) Reload Nginx
service nginx configtest
service nginx reload
Check all your Configuration for the following Parts in the listen directive:
"default_site" and "_"
Both work as an Catch all mechanismus.
Edit nginx.conf
remove all includes and add:
include /etc/nginx/sites-enabled/*
Following this procedur, you have no "Wildcard" Nginx config anymore. To enable "Catch all", just create a new config, or edit a existing config and add "default_server", looks like:
server
listen 80;
listen 443 ssl default_server;
...
BR Bernd
edited Nov 30 '15 at 11:47
TODD
33
33
answered Nov 27 '15 at 13:18
BerndinoxBerndinox
155119
155119
I have compiled nginx manually, there is not sites enabled / sites available directories. After all that only serves the purpose of including or not an specific site configuration.
– xavier
Nov 27 '15 at 14:35
hmm, strange. catch all is normaly just provided through "default_server" or "_". Can you show us: include hhvm.conf; include domain.com-ps.conf; include multisite.conf;
– Berndinox
Nov 27 '15 at 14:40
I have added via edit the config you are asking for.
– xavier
Nov 30 '15 at 11:27
add a comment |
I have compiled nginx manually, there is not sites enabled / sites available directories. After all that only serves the purpose of including or not an specific site configuration.
– xavier
Nov 27 '15 at 14:35
hmm, strange. catch all is normaly just provided through "default_server" or "_". Can you show us: include hhvm.conf; include domain.com-ps.conf; include multisite.conf;
– Berndinox
Nov 27 '15 at 14:40
I have added via edit the config you are asking for.
– xavier
Nov 30 '15 at 11:27
I have compiled nginx manually, there is not sites enabled / sites available directories. After all that only serves the purpose of including or not an specific site configuration.
– xavier
Nov 27 '15 at 14:35
I have compiled nginx manually, there is not sites enabled / sites available directories. After all that only serves the purpose of including or not an specific site configuration.
– xavier
Nov 27 '15 at 14:35
hmm, strange. catch all is normaly just provided through "default_server" or "_". Can you show us: include hhvm.conf; include domain.com-ps.conf; include multisite.conf;
– Berndinox
Nov 27 '15 at 14:40
hmm, strange. catch all is normaly just provided through "default_server" or "_". Can you show us: include hhvm.conf; include domain.com-ps.conf; include multisite.conf;
– Berndinox
Nov 27 '15 at 14:40
I have added via edit the config you are asking for.
– xavier
Nov 30 '15 at 11:27
I have added via edit the config you are asking for.
– xavier
Nov 30 '15 at 11:27
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f739332%2fnginx-configuration-is-catching-all-subdomains-without-a-wildcard-how-to-fix%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Sorry, what do you mean with a "default site config" ? What I do is to create a config file for each subdomain and for the main site ( the one I posted ) and then include each of these on the http config ( nginx.conf in my case )
– xavier
Nov 27 '15 at 12:44
There should be a sites-available and sites-enabled folder. In the sites-available folder should be a config called default. It should be then sym lined to sites-enabled. The idea is that this handles everything you don't have a config specifically for. The sites-enabled folder would be referenced from the nginx.conf file
– Drifter104
Nov 27 '15 at 12:51
1
@xavier It would help if you could post your nginx.conf, and your folder structure under /etc/nginx
– vic
Nov 27 '15 at 12:55
1
I have posted the nginx.conf on an edit. As you can see, I include the other sites configuration the same way I include the main domain config. I have compiled nginx manually so there is no sites-enabled / sites-available, I think that is an Ubuntu / Debian style package implementation.
– xavier
Nov 27 '15 at 13:02
1
@drifter104 that paradigm only holds on debian-based installs of Nginx. By default Nginx does not config like that
– Xyon
Nov 27 '15 at 13:03