Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include a proxy redirect into generated /etc/nginx/conf.d/default.conf ? #322

Open
bwalsh opened this issue Dec 21, 2015 · 1 comment
Open
Labels
kind/question Issue that might be transferred to Discussions

Comments

@bwalsh
Copy link

bwalsh commented Dec 21, 2015

Hi,

Thanks for a great product. I was up and running quickly using docker-compose.

However, I'm trying to understand how to include the following snippet into the generated default.conf

  location ~ /api(?<section>.*) {
      proxy_pass http://another.host/api/$section;
      proxy_set_header Host $host;
  }  

I've tried the following in my Dockerfile

FROM jwilder/nginx-proxy

COPY default_location /etc/nginx/conf.d/default_location
COPY default_location /etc/nginx/conf.d/kibana.ccc.org

No matter what I try, the resulting section still looks like such

server {
    server_name kibana.ccc.org;
    listen 80 default_server;
    access_log /var/log/nginx/access.log vhost;
    location / {
        proxy_pass http://kibana.ccc.org;
    }
}
@md5
Copy link
Contributor

md5 commented Dec 21, 2015

I believe you want those files in /etc/nginx/vhost.d, not /etc/nginx/conf.d.

That being said, I'm not sure you can achieve what you want currently because the /etc/nginx/conf.d/default_location file will not override the hard-coded proxy_pass. I'm not sure what Nginx will do if you have multiple proxy_pass statements in a single location block.

@tkw1536 tkw1536 added the kind/question Issue that might be transferred to Discussions label Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Issue that might be transferred to Discussions
Projects
None yet
Development

No branches or pull requests

3 participants