have a docker container exposed to public by "mapping" it to a sub url of a domain name, e.g. domain.com is served by nginx on host machine, and domain.com/sub is served from the docker container
my google-fu seems to be not that great, i can't make it work
so far the relevant part of the config on my host machine is
location /sub/ {
if ($request_uri ~* "/sub/(.*)") {
rewrite ^/sub/(.*) $1 break;
proxy_ignore_client_abort on;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:5051;
}
}
this results in 404 on access. if i create the sub directory in nginx www root, i get "index of".
if i remove the if and the rewrite, it kinda works, but the container should receive the bare uri /, instead it's getting the sub one
what am i missing?
what is that if supposed to do
Why not use subdomains, which is also more secure?
Обсуждают сегодня