Temporary test domain name or way to achieve this

Hi I created a multi install with a single website and was able to do that because there was a working IP address. Now I have 1 site there however I can’t use the ip address (or can I) to go to the NEW folder for the new site to test. In previous hosting scenarios I was able to turn on what was called a testing url which gave access to a folder. I tried this in my sites-available block…rewrite ^$ var/www/ redirect; This didn’t work as the old site just 404’d

I have also tried to edit the /sites-available/digitalocean file which as I understand is the default from my one click install of LEMP. So I thought this could be the file the dedicated IP address could root through first…so I pointed the root directive to my new sites folder of that but it didn’t do anything and I still get to my initial website.

How to achieve this? Thanks


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

A better option might be to simply create a symbolic link.

A symbolic link is part of your file system (nothing to do with Apache or nginx).

It creates a “virtual” directory which maps to a directory elsewhere in the file system.

You would run this via the command line (make sure the newsite folder doesn’t already exist):

ln -s /var/www/ /var/www/

This creates a “vitual” link under /var/www/ which maps to /var/www/

Anyone visiting will see the contents of /var/www/

Out of interest what operating system are you using locally on your own computer?

If you’re using Windows you can edit the file C:\Windows\System32\drivers\etc\hosts and add a line like this:

Replace with the IP address of your droplet. will then map to your droplet from your local work station, bypassing any external DNS lookup.

Setup a new virtual host under sites-enabled.conf for and away you go.

In my case what seems to have been lacking is a default server and now it seems to be working and what @DigitalCarrot would have got had I posted my server block code…many thanks to you @DigitalCarrot

SO in my default site block I now have this

server {
        listen 80 default_server;
        listen [::]:80 default_server;


server {
        listen 80;
        listen [::]:80;

Now when I use the IP address remotely I can access what this default site points to…