P
P
pr0b3l2018-12-24 17:57:08
Nginx
pr0b3l, 2018-12-24 17:57:08

nginx. How to proxy requests from one url to another using different ports (SOLVED)?

Hello!
There is a server on which to deploy Nginx (IP1).
I would like to be redirected to another url (IP2) with a different port when accessing this resource on port 80.
I see solutions with proxy_pass, but the path is indicated there without specifying the port.
My config:

server {
    listen 80;
    server_name IP1;
    location / {
        proxy_pass http://IP2:1111;
    }
}

If you do not specify port 1111, then everything works fine. How to be, tell me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pr0b3l, 2018-12-25
@pr0b3l

The issue was resolved. it was necessary to write
setsebool -P http_can_network_connect 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question