1 message in ru.sysoev.nginxFastCGI+PHP - Script_Name
FromSent OnAttachments
Jonathan VanascoDec 9, 2006 9:11 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:FastCGI+PHP - Script_NameActions...
From:Jonathan Vanasco (ngin@public.gmane.org)
Date:Dec 9, 2006 9:11:09 am
List:ru.sysoev.nginx

I'm trying to emulate the behavior of SERVER['SCRIPT_NAME'] of apache/ mod_php under nginx/fastcgi+php -- specifically in the situation where a rewrite rule is involved. i'm offloading a page from mod_perl onto php, and can't figure out how to migrate this code (it works on mod_php on a dev box)

under apache-

url: findmeon.com/user/123456/ file: /user/index.php rewrite rule: RewriteRule ^/user/([a-z0-9]{4,16})(\/[.]*)?$ /user/index.php?&% {QUERY_STRING}&fmo_mode=user&fmo_user=$1 [T=application/x-httpd-php,L]

result: SERVER['SCRIPT_NAME']= /user/$1/index.php

under nginx

url: findmeon.com/user/123456/ file: /user/index.php rewrite rule: rewrite "^/user/([a-z0-9]{4,16})(\/[.]*)?$" /user/index.php?& $query_string&fmo_mode=user&fmo_user=$1 last; config: fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name;

result: SERVER['SCRIPT_NAME']= /user/index.php

nginx + fastcgi are doing exactly as they should.

i just need to figure out how to change the config like for "fastcgi_param SCRIPT_NAME" to reflect the pre-rewrite rule script name (which is what apache does)

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | FindMeOn.com - The cure for Multiple Web Personality Disorder | Web Identity Management and 3D Social Networking | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | RoadSound.com - Tools For Bands, Stuff For Fans | Collaborative Online Management And Syndication Tools | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -