Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

phrfpeixoto's avatar

Struggling with Laravel 5.2 under nginx subfolder

Hi there.

I have a registered domain which will hold a WP blog on it's main address. I want to deploy a Laravel 5.2 app to a given folder: phpeixoto.com.br/gwlito

I've tried every sample config I could find on the internet, but can't get that to work. Don't know if it's actually a PHP-FPM issue, or nginx's

Can you guys help me out? My server is hosted at Digital Ocean:

The WP blog will go under /var/www/html (I don't have access to that, so I just put the default Digital Ocean dummy page there)

The Laravel application is under /var/www/gwlito

Here's my nginx config:

https://paste.laravel.io/a2yok#

Getting to https://phpeixoto.com.br/gwlito/ just returns me a blank page. No significant log on nginx, php-fpm or the app log

0 likes
3 replies
Screenbeetle's avatar

Hi phrfpeixoto.

Have you thought about installing laravel into a subdomain rather than a subdirectory? Laravel is much better suited to being in the root of a domain.

bashy's avatar

You shouldn't need to rewrite it using an alias.

Just direct the location block to the index.php file (using try_files as you have) and it should pick it up.

Please or to participate in this conversation.