how can i quickly handle alternate config for site downtime?

Igor Clark lists at
Wed Jan 7 20:41:54 MSK 2009

Merlin wrote:

> Yes, it sets up a location that you are most likely never going to use.
> It appears to be convention within nginx configurations.  I don't know
> when it started, but I've seen it on this list for some time now.  I am
> pretty sure that you could use other special characters if you wanted,
> too, it's just a character to nginx.

Igor S refers to these as "named locations". A common use is e.g.

    location / {
        error_page 404 = @myapp;

    location @myapp {
        fastcgi_index blah;
        fastcgi_param ...;

so that any URLs that would normally go through rewrite stages like

    if (! -e $uri) {
        rewrite ....;

are automatically routed to the appropriate back-end.

In release 0.7.27 Igor S added the try_files directive which works 
similarly but adds a list of filesystem locations to try before hitting 
a named location as default, and only logs errors in case of total 
failure (as I understand it):

        location / {
                try_files $uri $uri/index.html @myapp;

I haven't seen any characters other than @ used to notate named 
locations, but I'm sure Igor S will be able to elucidate.

Posted via

More information about the nginx mailing list