Question

How to access to web server behind internet gateway within VPC?

I hosted my web server with nginx server blocks a VPC and put it behind internet gateway as described here. So my web server public ip is not usable. How do I access to my website through internet gateway?. I couldn’t find any docs.

And also if I add another droplet for API behind internet gateway, how do I connect to the API from web server? I’m beginner and learning new things. Of course I don’t need all those thing I asked above. I’m curious and want to how things works.

Thanks😃.


Submit an answer
Answer a question...

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.

Bobby Iliev
Site Moderator
Site Moderator badge
May 24, 2022

Hi there,

The example that you’ve shared is mainly aimed to show how you can setup a NAT so that the outgoing traffic from your backend Droplets would go through the gateway server. So it goes like this:

  • Request made from your backend server -> Goes out via the gateway -> Reaches the public internet

The case that you are describing is for inbound traffic. So you could do that with an Nginx reverse proxy:

  • Request from the outside world -> hits the gateway -> gets routed to the backend service

Here is a quick diagram of how it would look with a DMZ load balancer:

DMZ load balancer

Hope that this helps!

Best,

Bobby