Welcome! Log In Create A New Profile

Advanced

Wildcard *.foo.com to handle error_pages across subdomains? Not working.

Posted by meatball 
Wildcard *.foo.com to handle error_pages across subdomains? Not working.
November 04, 2010 03:39PM
Hello,

I have multiple subdomains and would like to specify error_page locations only once, and have all the subdomains use this, instead of inserting each error_page into the individual server blocks. Does this make sense?

[code]
server
{
server_name *.foo.com;

location = /core.css
{
root /users/name/core;
}

error_page 403 /403.html;
location = /403.html
{
root /users/name/core.error;
}
}
[/code]

I would expect the *.foo.com to catch all the requests for the error_page, so that www.foo.com, webmail.foo.com, dev.foo.com etc would all return the same error_page. But they all return a 404 instead of following the wildcard. Is it not possible to accomplish this, or am I doing something wrong?

I also tried this, but it didn't work either. I do not fully understand using "_" though to be honest.

[code]
server_name _;
[/code]


Thanks for any pointers. Let me know if I need to explain this better.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 167
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready