How to map my local ip with my vps_ip?

August 17, 2015 1.8k views

I have bought virtual host for one year,they gave me an vps_ip to use. I went surfing the internet this way:my pc connect to a wireless route ,wireless route connect to the adsl. When to input in the firefox,the route status is as the following:

subnet mask:

IP :
subnet mask:

inet addr: Bcast: Mask:

I have build a wordpress on my local .
How can i map or say bind with my vpsip?
It is the goal that anyone input my vps
ip in the firefox ,the wordpress in my local will be displayed.

2 Answers

Hello elearn,

If I am understanding this correctly, you would like to use the IP of your droplet here at digitalocean to let the public access your wordpress site with that?
If I am right, this is not possible. The IP you are able to use, is only avaiable for the droplet you buy. However you could use your droplet as a little proxy, to redirect the IP of your droplet to your home network. There are 2 sections you need to work on to get this working:

  • Your local network
  • Your public droplet system

Local network
On your router you need to portforward port 80 to the outside of your network. So if you got the wordpress site running on the server with local ip "" you need to portforward 80 on that machine on TCP. With this, people are able to access the site without being blocked by your router/modem.
If you also go a firewall on your webserver machine, you also need to open port 80 on there

Public Droplet System
You can let your DO droplet handle redirections to your own local webserver. To get this working you could use nginx for example. Things need to be done:

  • Install nginx
  • Configure nginx
  • Test

To install nginx, simply run sudo apt-get install nginx
After the installation of nginx is done, you will be able to find the configuration inside /etc/nginx/sites-available. So now we need to configure nginx, to let it handle and redirect the requests. Nginx will have a default configuration file, wich we will modify:

sudo nano /etc/nginx/sites-available/default

Inside you will probably see some codes and some comments. Delete all of it and use the following:

server {
        listen *:80;


        rewrite .*$request_uri permanent;


Modify the config to your needs. So change to the VPS IP you got.
Also change to your PUBLIC WAN IP. If this is the ip as you say in your question, don't change this.

Now save the config file and restart nginx

sudo service nginx restart

Thats it! :) Now go to and if everything went well, you should be redirected to
Hope this will work for you, if not you can come back here.

Success, do as you say.
To make the problem complicated, the ip address of my wan ip (public ip) is dynamics ,it change every 30 minutes, how to fix the code then?

Have another answer? Share your knowledge.