realtebo
realtebo

Reputation: 25645

Laravel + Nginx: can we serve app from /something and from a different folder?

On disk

I must serve

The problem is also that Laravel's app are entirelyt served from /var/www/laravel/public/index.php as you of course know

I am not able to set nginx to serve /laravel and all subroutes using laravel app

Upvotes: 1

Views: 247

Answers (1)

Daniel W.
Daniel W.

Reputation: 32290

Something as simple as this should work:

server {
    server_name domain.tld;

    location / {
        root /var/www/mainapp;
        # add php/fpm config
    }

    location /laravel {
        root /var/www/laravel;
        # add php/fpm config
    }
}

Upvotes: 1

Related Questions