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

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.