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

peterdickins's avatar

View website using IP address in Forge

I have setup 2 sites on one Digital Ocean droplet using Forge:

/home/forge/site1.com
/home/forge/site2.com

My issue is that I have only just updated the DNS to point to the newly created server. Is there a way I can view the sites using the IP address to make sure everything is working ok?

0 likes
3 replies
aurawindsurfing's avatar

@peterdickins did you ever checked cloudflare? You can register your domain there and then let cloudflare handle all of your dns stuff. The beauty of it is that any change to IP will be more less visible immediately everywhere in the world.

Oh and it is free for basic usage ;-)

Enjoy!

bugsysha's avatar

Edit the hosts file on your local machine. On unix based systems it is usually located at /etc/hosts. For Windows it should be C:\Windows\System32\Drivers\etc\hosts but you can Google cause I might be wrong.

  1. Edit /etc/hosts by opening it with user that has admin access
  2. Add lines for both sites in following format 123.123.123.123 site1.com and 123.123.123.124 site2.com
  3. Overwrite that file by saving it
  4. Open incognito mode and type in site1.com in your browser

Note: replace 123.123.123.123 and 123.123.123.124 with actual IP addresses.

1 like
squibby's avatar

This can be done by just adding 'default_server' to your nginx block. This is what is shown for the 'default' site when you first create a forge server. It will only work for 1 site at once though for testing.

Something like this:

server {
    listen 443 ssl default_server;
    listen [::]:443 ssl default_server;
    server_name default;

.....

Please or to participate in this conversation.