Question

Use Proxy For Dynamic IP Address

Is it possible to use a proxy service, so that for each HTTP request from the server to outside, I’ll get different IP address

Subscribe
Share

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.

This should be possible but there are a few moving pieces to think about.

You’ll want to set up a Dynamic DNS service. There are free public options or you could set up something yourself. The way this works is that the computer with a dynamic IP address runs an agent that reports into the Dynamic DNS service when it’s IP changes and a DNS record is automatically updated. These records are set up with a very low TTL (time to live) so that the changes happen as seamlessly as possible.

Once you have this in place, you can set up nginx using the proxy_pass directive so that it will pass requests to that new dynamic DNS name rather than an IP address. This way your static IP will host your proxy but the content served will come from your computer with the dynamic IP.