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

elliotk's avatar

Laravel Forge - Nginx respond on IP

I have been using Forge for some time, with my servers behind a load balancer (Digital Ocean). DO is currently configured to do a simple check of port 80 using TCP. This detects if the server is online and nginx running, but not if php-fpm is up or whether there is database connectivity etc.

I'd like to change this to do health checks via HTTP, that way I can make some simple checks of the server and return a 200 if all is good and keep the server in the pool.

It seems when I try and access the Forge server via IP (rather than domain), i get a nginx 404, which causes DO to remove the server from the pool as its expecting a 200. Can anyone help me configure a new site in nginx that would respond on IP and load a simple php script in a given path eg /var/www/html

Any help appreciated.

Elliot

0 likes
3 replies
elliotk's avatar

Anyone give me a lift on this one?

Xsecrets's avatar
Xsecrets
Best Answer
Level 19

I don't know how to do it off the bat, but if you spin up a new server and look at the default site that will answer on the ip so you should be able to look at that nginx file. I have removed all my default sites so I can't currently look.

elliotk's avatar

@xsecrets i don't know why i didn't think to spin up another server, anyway I got the config from that one and copied it over - job done.

Please or to participate in this conversation.