Can I disable HTTPS on a specific path only, using jwilder/nginx-proxy?

428 Views Asked by At

I have a web app reverse-proxied through jwilder/nginx-proxy, which applies my TLS certificate. There is one path served by this app that I want to either have TLS disabled, or at least optional if http:// is specified.

Using custom configuration, virtual host specific configs, or anything short of editing the template... is there a way to do this?

I have tried:

  1. Setting the target container as HTTPS_METHOD: noredirect. (But this makes HTTP possible on all paths, obviously.)
  2. Put a location config in e.g. /etc/nginx/vhost.d/app.example.com but these config files seem to get added to the server section listening to port 443. So that does not help.
  3. Tried combining the two above, but adding a location like:
    location / {
      return 301 https://$host$request_uri;
    }

(But that leads to nginx complaining that there are duplicate locations.)

0

There are 0 best solutions below