NGINX and Lumen (Laravel) 5

Ben ben+nginx at
Wed Jul 27 13:43:32 UTC 2016


I'm having a frustrating time trying to get Lumen (a.k.a Laravel) 
working on my NGINX install.

At the moment, the best I can get NGINX to give me is 405 errors. Which 
translates to the following error.log entry :

failed (13: Permission denied), client:, server:, request: "POST /lumen/ HTTP/1.1", host: ""

That error is in response to a simple cURL:

curl -X POST  --data-raw  "demo=demo&example=example"

location /lumen {
root /usr/share/path/to/my/lumen/public/directory/<snip>/public;
deny all;
expires 0;
add_header Pragma "no-cache";
add_header Cache-Control "no-cache, no-store,must-revalidate";
#I have tried various "try_files..."
#try_files $uri @lumen;
try_files $uri $uri/ /index.php?$query_string;
location @lumen {
fastcgi_param SCRIPT_FILENAME 
fastcgi_param SCRIPT_NAME /lumen/;
fastcgi_param  PATH_INFO        $fastcgi_path_info;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_param QUERY_STRING    $args;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
         return 405;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param  PATH_INFO        $fastcgi_path_info;
include fastcgi_params;

More information about the nginx mailing list