drupal-with-nginx icon indicating copy to clipboard operation
drupal-with-nginx copied to clipboard

include apps/drupal/drupal.conf; drupal.conf

Open roni5 opened this issue 11 years ago • 5 comments
trafficstars

Hi I'm using the openresty source, and was using basically perusio conf , but without include apps/drupal/drupal.conf; enabled and was using location @rewrite's instead. When I use drupal.conf (@drupal) , I can not access my twilio php file which is just a bit of html, js, php api to twilio. It sits in a directory /var/www/mysite/twilio/hello-monkey.php ... everything else works G8 , until I try to access the hello-monekey.php I get a 404 I put this file in another site same conf but without the include apps/drupal/drupal.conf; and by changing chmod 755 can see hello-monkey.php in another directory (site) made the library path absolute, still no joy ? The only other thing I have done is install Memcache and drupal module. I'm actually getting a xml message from my database saying leave a message. I also tried to disable the last section pps/drupal/drupal.conf; to allow php access . that just let me download the file so I put it back.

Any ideas , would be most appreciated .

roni5 avatar Oct 03 '14 12:10 roni5

Hey Roni!!! you can't execute a php in that way you need to pass thru by fastcgi. Try to add a location rule to your nginx conf file.

location = /<uri>/hello-monkey.php { fastcgi_pass phpcgi; }

lucasmingarro avatar Oct 03 '14 12:10 lucasmingarro

Hi Lucas , would that be its own section within persusio nginx conf or in the sites-enabled conf ? Thank you :)

roni5 avatar Oct 03 '14 13:10 roni5

I think a good practice is add it to your site conf. But is up to you :-)

lucasmingarro avatar Oct 03 '14 13:10 lucasmingarro

Thank you again Lucas , I did what you said and with another file ... for anyone having this problem perusio conf restrict arbitrary php set a location for all call files as well

roni5 avatar Oct 03 '14 17:10 roni5

no problem man!!

The restriction is for security reasons and I think is in the right way, very restrictive just for Drupal's needs and then if you need execute more php besides /index.php you can add an nginx location rule.

lucasmingarro avatar Oct 03 '14 18:10 lucasmingarro