I have a Wireguard VPN on my droplet and want to open ports for my email server which is connected via VPN. As i have seen the firewall only supports opening ports for specific IP’s from the outside? So is it possible or should i route it? I already tried it to route with nginx with this but it did not work
# nginx wireguard config
server {
listen 51820;
location / {
proxy_pass http://wireguard:51820;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
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!
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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Heya @craftycodes,
In order to open a port there is something that needs to listen to it. Opening a port essentially means allowing network traffic to flow in and out of a specific communication endpoint on a Droplet. However, for that port to be useful, there needs to be a program or service on the computer that is actively listening to that port.
Think of a port as a door, and the service as the thing behind the door. Opening the door (port) doesn’t do much if there’s nothing on the other side to interact with. When a service is set to listen on a specific port, it means that it’s waiting for incoming connections or data on that port.
Anyway, in order open a port on your Droplet you need to use your firewall service, I would asume
UFW
.First check the status
Then you can allow a port like so
Where 22 is your port and tcp is the time of connection.