I'm trying to do something with nginx that i admittedly took for granted would be pretty easy.
I have a docker host with several web based containers, not all of them are on port 80, but i would like be able to access them with a standard URL.
I want to use an nginx container on the docker host to accomplish this.
So, using the standard nginx image , I created a
server {
listen 8080;
server_name jenkins.nikkyrron.com;
location / {
proxy_pass http://jenkins:8080/;
}
}
But there is something wrong with this approach because all URLs end up going to the jenkins server because it is the first one or some such.
I am assuming that the server\_name directive works the way Apache does name-based virtual hosting?
What am I doing wrong, or do I need to use the upstream directive instead?
I've actually got an entire course on nginx cued up to take, I just hoped that I could get this one thing going beforehand.
I’ve used this with testing rqlite in a docker container:
# a simple proxy into a docker network
user nginx;
worker_processes auto;
events { }
http {
server {
listen 8888;
location / {
resolver 127.0.0.11 ipv6=off;
proxy_pass http://$http_host$uri$is_args$args;
}
}
}