Welcome! Log In Create A New Profile

Advanced

Re: Not opening default site page via FastCGI and try_files

September 04, 2009 10:53AM
On Fri, Sep 04, 2009 at 02:31:51PM +0200, Ale Ru wrote:

> Igor Sysoev wrote:
> > On Fri, Sep 04, 2009 at 01:46:01PM +0200, Ale Ru wrote:
> >
> >> site.com/any-wildcarded-page-name-at-all
> >> listen 80;
> >> server_name ~^(www\.)?(.+)$;
> >> root /var/www/$2/htdocs;
> >>
> >> location / {
> >> try_files $uri $uri/ $uri/index.htm @django;
> >> index index.html index.htm;
> >> }
> >
> > Try
> >
> > location / {
> > try_files $uri $uri/index.htm @django;
> > }
> >
> > or
> >
> > location / {
> > try_files $uri $uri/ @django;
> > index index.htm index.html;
> > }
>
>
> This is what i have in nginx.conf. It works for all files except site
> root page.
> What is the difference from my original config? i tried both changes
> (delted $uri/ or delted $uri/index.htm) - the same effect.

The difference is only in order of file existance testing.

> when i type domain.com/index.htm (and there are no static index.htm
> page) i get the page from django FCGI script
>
> when i type domain.com/ (and there is a *static* page called index.htm)
> i get static page
>
> but when i type domain.com/ (and there is no static page called
> index.htm) i get
> 403 Forbidden
> nginx/0.7.61

Then you need

location @dajno {
fastcgi_index index.htm;
...


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

Not opening default site page via FastCGI and try_files

Ale Ru September 04, 2009 10:53AM

Re: Not opening default site page via FastCGI and try_files

Igor Sysoev September 04, 2009 10:53AM

Re: Not opening default site page via FastCGI and try_files

Ale Ru September 04, 2009 10:53AM

Re: Not opening default site page via FastCGI and try_files

Igor Sysoev September 04, 2009 10:53AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 179
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready