NGINX and Lumen (Laravel) 5

Ben ben+nginx at list-subs.com
Wed Jul 27 13:43:32 UTC 2016


Hi,

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 :

  stat() 
"/usr/share/path/to/my/lumen/public/directory/<snip>/public/lumen/" 
failed (13: Permission denied), client: 192.168.121.10, server: 
my.example.com, request: "POST /lumen/ HTTP/1.1", host: "my.example.com"

That error is in response to a simple cURL:

curl -X POST  --data-raw  "demo=demo&example=example" 
https://my.example.com/lumen/

location /lumen {
root /usr/share/path/to/my/lumen/public/directory/<snip>/public;
allow 192.168.0.0/16;
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 
/usr/share/path/to/my/lumen/public/directory/<snip>/public/index.php;
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