perusio / drupal-with-nginx

Running Drupal using nginx: an idiosyncratically crafted bleeding edge configuration.
855 stars 246 forks source link

include apps/drupal/drupal.conf; drupal.conf #185

Open roni5 opened 10 years ago

roni5 commented 10 years ago

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 .

lucasmingarro commented 10 years ago

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; }

roni5 commented 10 years ago

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

lucasmingarro commented 10 years ago

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

roni5 commented 10 years ago

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

lucasmingarro commented 10 years ago

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.