0

I have a Redhat Linux server. In that, I installed docker and run docker containers in it. Now I want to map a domain to docker containers by using Nginx.

What is the correct process to map domains by using Nginx, install Nginx as a container or Install Nginx in the Host server? Any references?

1
  • With, uh, DNS? this question makes no sense as presented. Commented Dec 6, 2022 at 8:55

2 Answers 2

0

Basics Nginx is a webserver that can be used as a reverse proxy. I would suggest having a look at the nginx.conf file, where you can configure DNS redirects accordingly.

Host Nginx on host means you would need a port mapping( host -> docker container) of all the docker containers in order to redirect traffic to the correct container. Wouldn't suggest this.

Docker Nginx on docker on same docker network would be my suggested approach: you can use docker DNS and only map the nginx server itself(ports 80/443).

Maybe a tool based on nginx would help here, which already has lets encrypt support: https://nginxproxymanager.com/

0

I guess you want to join the host to a (e.g. windows-) domain and then use this membership of the host in the containers instead of joining the containers themselves to the domain.

I guess that would heavily depend on the container because at least in red hat linux you use realm and SSSD to manage all the necessary processes. You would need to have that in the container and then map all the necessary files for all services. That would be a lot of stuff and i am not sure if it would work.

Another problem, if you have more than one container you map the domain to, would be that you have more than one (virtual) host pose as one to the domain. I guess that does not work with kerberos because they would get in the way of each other when exchanging tickets.

It is probably better to join the containers themselves to the domain. But you would need to have some clever way to pass the admin password into that process or it can not be automated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.