php file with no extension

Stefanita rares Dumitrescu lists at ruby-forum.com
Sun Jan 13 18:41:40 MSK 2008


Maxim Dounin wrote:
> Hello!
> 
> On Fri, Jan 11, 2008 at 10:57:38PM +0100, Stefanita rares Dumitrescu 
> wrote:
> 
>>i am talking about this:
>>
>>the file is named FILE. it generates a directory structure like the one 
>>below. so i would like all requests that begin with FILE, to be treated 
>>as php, and parsed accordingly.
>>
>>FILE/video/1/thumb
> 
> Try something like
> 
>      location /FILE/ {
>          proxy_pass ...;
>          ...
>      }
> 
> Maxim Dounin
> 
> p.s. You are posting to mailing list, not forum. Please don't post
> multiple messages unless really need to and quote previous
> messages.

sorry for the erasing quotes i forgota bout the mailing list.

i made some modifications to my setup. took off the apache, and loaded 
php-fastcgi.

so the current config looks like:

    server {
        listen       1.2.3.4:80;
        server_name  host1.com;
        #charset koi8-r;
        access_log  logs/fs01.nl.eu.bioget.com.access.log main;

        location /data {
            root   /home/fs01/storage;
            index  index.html index.htm index.php;
        }

        # serve static files directly
        location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|flv|zip|mp3)$ {
            root              /home/fs01/storage;
            access_log        off;
            expires           30d;
        }


        location /get/ {
                fastcgi_pass   127.0.0.1:8000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME 
/home/fs01/www$fastcgi_script_name;
                include        /usr/local/etc/nginx/fastcgi.fs01.conf;
        }


the file 'get' generates directory structure like:

http://host1.com/get/picture/5/data

/usr/home/fs01/www/get(25) : Notice - Undefined index:  REQUEST_URI
/usr/home/fs01/www/get(26) : Notice - Undefined index:  SCRIPT_NAME

below you have the fastcgi params config file.

[root at fs01:/home/fs01/www] cat /usr/local/etc/nginx/fastcgi.fs01.conf
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        //$fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
# fastcgi_param  REDIRECT_STATUS    200;
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list