0

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.)

courtlandj
  • 435
  • 9
  • 19
  • Would it be possible to use a different hostname, i.e. `secure-api.example.com` and `api.example.com`? That may bring in CORS issues if you're also doing UI stuff but it would allow you to separate the SSL vs non-SSL areas. – stdunbar Apr 13 '22 at 21:33
  • I would prefer not to, but I am negotiable here... I don't think CORS would be an issue, as the path I am concerned with is "just" backend data shuffling around. – courtlandj Apr 13 '22 at 21:37

0 Answers0