From 5d6f6828f983808b6070b296491ab5f22b6047c3 Mon Sep 17 00:00:00 2001 From: Neil Chintomby Date: Sun, 13 Mar 2011 23:21:15 -0400 Subject: [PATCH] use try_files instead of if in the deploy example. --- doc/site/deploy.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/site/deploy.rst b/doc/site/deploy.rst index a90334b3..b95ef600 100644 --- a/doc/site/deploy.rst +++ b/doc/site/deploy.rst @@ -53,14 +53,16 @@ An `example configuration`_ file for fast clients with Nginx_:: root /path/to/app/current/public; location / { + # checks for static file, if not found proxy to app + try_files $uri @proxy_to_app; + } + + location @proxy_to_app { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; - if (!-f $request_filename) { - proxy_pass http://app_server; - break; - } + proxy_pass http://app_server; } error_page 500 502 503 504 /500.html;