E
E
Eugene2018-09-28 17:52:24
Nginx
Eugene, 2018-09-28 17:52:24

How to do port forwarding in nginx?

How to perform port forwarding in NGINX?
Forward IP/port to http://IP:port

Answer the question

In order to leave comments, you need to log in

2 answer(s)
@
@antoo, 2018-09-28
@you_are_enot

Perhaps something like this?

location ~ "/port/(\d+)" {
        proxy_pass http://127.0.0.1:$1/;
}

C
chupasaurus, 2018-09-28
@chupasaurus

If you want pure port forwarding, then the stream_proxy module will help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question