Hi all!
I need to make sure try_files does not send to a static file if $args are included.
#if ($args != "") {rewrite ^ @ app;} # tried here and below.
location = / { rewrite ^ /home/index/$host; }
location / {
if ($args = "") { rewrite ^ @app;}
try_files /downtime.html $uri/index.html $uri @app;# double rewrite error
}
location @app {
proxy_pass http://app_server;
...
I also tried something like this, but "break" makes it not match the location @app either.
Thanks for any help you can give me, my forehead is sore from pounding it against the keyboard :)
-Kevin
location / {
# reload=auto refreshes cached content. hmm, easy to have this match twice which causes problems!
if ($http_cache_control ~* "no-cache") { rewrite ^ $uri?recache; }
if ($args != "") {rewrite ^ @app;}
location = / { rewrite ^ /home/index/$host; }
location ~* /$ { rewrite ^ $uri/index.html; }
# after break won't match any location rules either :(
if (!-f $uri) {rewrite ^ @app; break;}
}
location @app {
proxy_pass http://app_server;