try_files and static web site

merlin corey merlincorey at dc949.org
Wed Jul 8 02:02:56 MSD 2009


Agreed.  There is nothing it is doing, no fallback location (always
should be your last location in try_files).

On Mon, Jul 6, 2009 at 10:47 PM, Michael Shadle<mike503 at gmail.com> wrote:
> I see no reason to be using try_files at all in your config.
>
> Sent from my iPhone
>
> On Jul 6, 2009, at 10:33 PM, Jauder Ho <lists at ruby-forum.com> wrote:
>
>> I have a site that is completely static and I figured I would use
>> try_files however this results in HTTP 500 errors for directories i.e.
>> trying to get to http://foo.com/bar/ results in a 500 error. What's
>> wrong with this config? Thanks.
>>
>> --Jauder
>>
>>  server {
>>   # port to listen on. Can also be set to an IP:PORT
>>   listen 80;
>>
>>   # Set the charset
>>   charset utf-8;
>>
>>   # sets the domain[s] that this vhost server requests for
>>   server_name www.foo.com;
>>
>>   # doc root
>>   root /var/www/foo.com;
>>
>>   # vhost specific access log
>>   access_log  /var/log/nginx_access.log  main;
>>
>>
>>   # Catchall for everything else
>>   location / {
>>     root /var/www/foo.com;
>>     access_log off;
>>
>>     index index.html index.shtml;
>>     expires 1d;
>>
>>     try_files $uri $uri/;
>>
>>     #if (-f $request_filename) {
>>     #  break;
>>     #}
>>   }
>>
>>
>>
>>   error_page 500 502 503 504 /500.html;
>>   error_page 404 /404.html;
>>
>>  }
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>
>





More information about the nginx mailing list