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

Steady-Entertainment's avatar

Nginx / Forge / 404

Hello community,

I installed my webserver via laravel forge on a custom VPS.

Before deployment it shows the php info correctly

Now after I deploy I get

nginx 404

this is my script:

cd /home/forge/offline.vision
git pull origin master
composer install --no-interaction --prefer-dist --optimize-autoloader

( flock -w 10 9 || exit 1
    echo 'Restarting FPM...'; sudo -S service php7.4-fpm reload ) 9>/tmp/fpmlock

if [ -f artisan ]; then
    php artisan migrate --force
fi

npm install
npm run dev

this is my domain

offline.vision

This is my .ENV

APP_NAME=Offline
APP_ENV=local
APP_KEY=base64:iXq3hk/PktcasdfdasffggasdfggafgagfgggTqNI=
APP_DEBUG=true
APP_URL=https://offline.test

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=forge
DB_USERNAME=forge
DB_PASSWORD="lolGqI9WblablablabqafWvuoUxx"

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

#MAIL_DRIVER=smtp
MAIL_DRIVER=log
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=
MAIL_PASSWORD=
[email protected]
MAIL_FROM_NAME=Example
MAIL_ENCRYPTION=TLS

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

TELESCOPE_ENABLED=false


SCOUT_DRIVER=null
SCOUT_QUEUE=true

ALGOLIA_APP_ID=
ALGOLIA_KEY=
ALGOLIA_SECRET=
0 likes
1 reply
fideloper's avatar
Level 11

It's likely that you need to update your Site within Forge and set the Web directory to /public.

When editing/viewing a Site within Forge, that option is in the Meta section.

This tells Forge to update Nginx to set the correct root (document root, the public web root directory) for the Laravel code base.

1 like

Please or to participate in this conversation.