Welcome! Log In Create A New Profile

Advanced

Re: NGINX and Lumen (Laravel) 5

Reinis Rozitis
July 27, 2016 12:40PM
> It exists all the way up to /public/, but NGINX seems to be adding the
> /lumen/ bit, which I guess is because of "location /lumen", but I'm not
> too sure how to go about telling it not to add the the location path as a
> suffix.

You could try to use the alias instead of root then (
http://nginx.org/en/docs/http/ngx_http_core_module.html#alias ).


In my mind though you're making it complicated.

In my experience all the Laravels work just simply by doing:

server {

root /path/laravel/public;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
}

All the non-existing files (it helps to define a seperate location for
static files though) and virtual paths are passed to the Laravel's
/index.php "router" and it knows what to do with it without any extra
mumbojumbo on nginx side.

rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

NGINX and Lumen (Laravel) 5

Ben July 27, 2016 09:44AM

Re: NGINX and Lumen (Laravel) 5

Reinis Rozitis July 27, 2016 10:52AM

Re: NGINX and Lumen (Laravel) 5

Ben July 27, 2016 12:24PM

Re: NGINX and Lumen (Laravel) 5

Reinis Rozitis July 27, 2016 12:40PM

Re: NGINX and Lumen (Laravel) 5

Ben July 27, 2016 01:18PM

Re: NGINX and Lumen (Laravel) 5

Reinis Rozitis July 27, 2016 03:44PM

Re: NGINX and Lumen (Laravel) 5

Francis Daly July 27, 2016 11:08AM

Re: NGINX and Lumen (Laravel) 5

Ben July 27, 2016 12:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 193
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready