Welcome! Log In Create A New Profile

Advanced

Re: try_files and redirect loops

Francis Daly
April 18, 2011 12:32PM
On Mon, Apr 18, 2011 at 11:37:06AM -0400, inspire22 wrote:

Hi there,

> I need to make sure try_files does not send to a static file if $args
> are included.

So... what do you want to happen if $args are included?

I'll guess "check for /downtime.html, then try the app server". In which
case, the following might be close:

===
server {
set $u1 $uri/index.html;
set $u2 $uri;
if ($is_args) {
set $u1 "";
set $u2 "";
}

try_files /downtime.html $u1 $u2 @app;

location @app {
proxy_pass http://app_server;
}
}
===

You'll need some extra bits, for example to define app_server, but it
might give some inspiration.

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

try_files and redirect loops

inspire22 April 18, 2011 11:37AM

Re: try_files and redirect loops

Francis Daly April 18, 2011 12:32PM

Re: try_files and redirect loops

inspire22 April 18, 2011 01:50PM

Re: try_files and redirect loops

Francis Daly April 18, 2011 02:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 231
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