Welcome! Log In Create A New Profile

Advanced

Something like try_files, but to try different subdomains? Fallback subdomains?

Posted by macbookwithpants 
Something like try_files, but to try different subdomains? Fallback subdomains?
September 23, 2013 01:27PM
Hi,

I'd like to have my server:

1) try the requested uri
2) if not found, try the requested uri on a subdomain (let's say "web")

The logic, as best as I can express it in nginx config syntax, is something like

location ~ /(.*)$ {
try_files /$1 http://web.somedomain.com/$1 =404;
}

But I don't think that syntax/try_files directive is meant to work with different subdomains.

Thanks for any advice!

---
mbwp
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 121
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready