A
A
akdes2017-09-13 13:06:46
Nginx
akdes, 2017-09-13 13:06:46

Nginx as a router for subdomains to ports, how?

Hello.
There is a subdomain abc.site.com which, through route53 through type A, shows on IP
On the server at the moment there are 2 docker projects, one on port 8081, the other on 8082
Target:
xy.abc.site.com -> abc.site.com :8081
xz.abc.site.com -> abc.site.com:8082
I tried using Type SVR - it did not work, it showed that dns was not found. Googling, I decided to do
it through proxy_pass in Nginx . by going to xy.abc.site.com, which refers to abc.site.com/xy and the server says:

location /xy/ {
        proxy_pass https://abc.site.com:8081/;
    }

I get a login page, service 8081, something goes wrong when submitting the form and returns me to the login page.
Tell me how realistic it is to implement what was conceived, how others do it, etc. etc.
Buying an IP for each service is not expedient and expensive, in this case.
Thanks a lot

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Mukovoz, 2017-09-13
@castomi

For each subdomain, you need to create a separate virtual host.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question