Welcome! Log In Create A New Profile

Advanced

Port Forwarding

Posted by BlueUrgency 
Port Forwarding
April 30, 2015 02:56PM
Hello All,

On my linux box, I only have ports 80 and 22 open to the public.

I have nginx listening on port 80.

Is there a way that I can forward public requests made to different ports using nginx.

For example,
I'd like the following requests from the internet:

xxx.xxx.xxx.xxx:8083
xxx.xxx.xxx.xxx:8086
xxx.xxx.xxx.xxx:8090
xxx.xxx.xxx.xxx:8099


to be forwarded to the same ports within my Linux box though port 80.


I was thinking of adding the following lines to my nginx.conf file:

server {
listen 8083
location = {
proxy_pass http://127.0.0.1:8083;
}

server {
listen 8086
location = {
proxy_pass http://127.0.0.1:8086;
}

server {
listen 8090
location = {
proxy_pass http://127.0.0.1:8090;
}

server {
listen 8090
location = {
proxy_pass http://127.0.0.1:8099
}


However, since only port 80 is open on my machine, would the above code be called?

Thanks in advance.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 122
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready