Is it possible using multiple directive on different root location? (Without Symlinks)

antituhan dewanggaba at gmail.com
Fri May 11 04:58:10 UTC 2012


So, how to solve the fastcgi php path with $document_root directive? By using
fix path like /home/antituhan/static + multiple fastcgi directive or any
directive to solve this issue?


Francis Daly wrote
> 
> On Thu, May 03, 2012 at 05:59:54AM -0700, antituhan wrote:
> 
> Hi there,
> 
>> How about php directive cliff ? I still get errors, my full directive
>> like
>> this http://fpaste.org/TOW3/
> 
> The important part here is that your top-level location{} directives are
> 
> location /
> location /cdnize/
> location ~ .php$
> 
> Each request will be handled by exactly one of those blocks.
> 
>> And i have a index.php on /home/antituhan/public_html to be triggered by
>> another upstream outsite with
>> http://static.antituhan.com/cdnize/index.php?q=datahere and it says not
>> found. Is my .php directive wrong ?
> 
> The request for /cdnize/index.php would be handled by the "location ~
> .php$" block.
> 
> In there, you have
> 
> fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
> 
> and $document_root is "root", which is inherited from the
> 
> root /home/antituhan/static;
> 
> directive at server level. So this request ends up (with the fastcgi
> server) looking for the file /home/antituhan/static/cdnize/index.php,
> which is presumably not what you want.
> 
> Probably you'll want to look at nesting a php location inside the /cdnize/
> one. And then moving the current php location to be inside the / one.
> 
> So you will probably need to have two or more locations that handle php,
> which each use a fastcgi_pass directive.
> 
> I'm sure there are recent examples of this set-up on the mailing list.
> 
> Good luck with it,
> 
> 	f
> -- 
> Francis Daly        francis@
> 
> _______________________________________________
> nginx mailing list
> nginx@
> http://mailman.nginx.org/mailman/listinfo/nginx
> 


-----
[daemon at antituhan.com ~]# 
--
View this message in context: http://nginx.2469901.n2.nabble.com/Is-it-possible-using-multiple-directive-on-different-root-location-Without-Symlinks-tp7516384p7549205.html
Sent from the nginx mailing list archive at Nabble.com.



More information about the nginx mailing list