Re: why my php file in subdirectory doesn't work?

Simon Liu simohayha.bobo at gmail.com
Wed Oct 12 03:40:55 UTC 2011


Thanks!

You should add fastcgi_index index.php.

On Tue, Oct 11, 2011 at 11:21 PM, suttles <nginx-forum at nginx.us> wrote:

> I have the variable set, or at least I think I do. Here is my config for
> the vhost.
>
> server {
>        client_max_body_size 20M;
>        listen 1192;
>        # .domain.com will match both domain.com and
> anything.domain.com
>        server_name rentavault.net;
>
>        # It is best to place the root of the server block at the server
> level, and not the location level
>        # any location block path will be relative to this root.
>        root /home/www/rentavault_net;
>
>        # It's always good to set logs, note however you cannot turn off
> the error log
>        # setting error_log off; will simply create a file called
> 'off'.
>        access_log /home/www/rentavault_net/logs/access_log.log main;
>        error_log /home/www/rentavault_net/logs/error_log.log info;
>
>        # This can also go in the http { } level
>        index index.php index.html;
>
>        location / {
>                # if you're just using wordpress and don't want extra
> rewrites
>                # then replace the word @rewrites with /index.php
>                try_files $uri $uri/ @rewrites;
>        }
>        location ~ ^/cgi-bin/(awredir|awstats)\.pl {
>                gzip off;
>                fastcgi_pass 127.0.0.1:9000;
>                fastcgi_param SCRIPT_FILENAME
> $document_root/cgi-bin/cgi-bin.php;
>                fastcgi_param X_SCRIPT_FILENAME
>                /home/www/rentavault_net/$fastcgi_script_name;
>                fastcgi_param X_SCRIPT_NAME $fastcgi_script_name;
>                include fastcgi_params;
>        }
>
> This config will not let me access the sub directory without index.php
> in the path of the browser. Very frustrating.
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,215921,216519#msg-216519
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



-- 
douban:www.douban.com/people/mustang/

blog: www.pagefault.info

twitter: www.twitter.com/minibobo

weibo:  www.weibo.com/diaoliang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20111012/e2b48e33/attachment-0001.html>


More information about the nginx mailing list