NGINX and Lumen (Laravel) 5

Ben ben+nginx at list-subs.com
Wed Jul 27 17:16:20 UTC 2016



On 27/07/2016 17:39, Reinis Rozitis wrote:

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

I will take a look at that link.  Thank you.


>
> In my mind though you're making it complicated.

Perhaps I should clarify context why it not I might not be making things 
"complicated" as you think.

This NGINX config relates to an SSL dev-site.  So I've got a buch of 
things I want to use the SSL site for, and laravel/lumen is just one of 
them, hence the desire (or rather need !)  to have it as a path rather 
than just make laravel/lumen "the" site.

>
> 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.
>

Will consider it, but as menitoned above, making laravel "the" site is 
not appropriate for my context.



More information about the nginx mailing list