Not opening default site page via FastCGI and try_files

Ale Ru lists at
Fri Sep 4 15:46:01 MSD 2009


I use FastCGI and try_files with Nginx.

FastCGI catches all url patterns and render appropriate page.

It works well for urls like

But it never works for site root

I use try_files.
Can you point me how to make default site URL work?

This is my Nginx conf:

server_name_in_redirect off;
listen 80;
server_name  ~^(www\.)?(.+)$;
root /var/www/$2/htdocs;

location / {
       try_files  $uri  $uri/ $uri/index.htm  @django;
       index index.html index.htm;

   location @django {
       fastcgi_param PATH_INFO $fastcgi_script_name;
       fastcgi_param REQUEST_METHOD $request_method;
       fastcgi_param QUERY_STRING $query_string;
       fastcgi_param SERVER_NAME $server_name;
       fastcgi_param SERVER_PORT $server_port;
       fastcgi_param SERVER_PROTOCOL $server_protocol;
       fastcgi_param CONTENT_TYPE $content_type;
       fastcgi_param CONTENT_LENGTH $content_length;
       fastcgi_pass_header Authorization;
       fastcgi_intercept_errors off;
       fastcgi_param REMOTE_ADDR $remote_addr;

Posted via

More information about the nginx mailing list