SteveLTN / https-portal

A fully automated HTTPS server powered by Nginx, Let's Encrypt and Docker.
MIT License
4.42k stars 296 forks source link

Noob question : custom proxy-pass to the URI on one domain only? #272

Open nunnsby opened 3 years ago

nunnsby commented 3 years ago

I'm trying to proxy the URI detail of (awstats) behind the root domain. The actual page I have to load is https://domain.tld/cgi-bin/awstats/awstats.pl?config=linoxide, but I really just want to go to https://domain.tld, and then let nginx proxy the rest of the URI so I don't have to remember it every time I visit the site.

I know I can't use domain.tld -> domain.tld/URI in the DOMAIN section of the config file.

I understand I have to use proxy-pass to do this, but when I look at the examples here, and I implement this line : - https-portal-data:/var/lib/https-portal it breaks as I already have multiple other domains using lets-encrypt (LE) and I can see it is because that is overwriting the default area that LE uses too.

How can I keep my other domains as is and still achieve the proxying of the URI to the root domain for this one site?

SteveLTN commented 3 years ago

I'm afraid I don't fully understand your problem.

Are your other domains managed by HTTPS-PORTAL as well? If so, there should be no problem. If you want to override Nginx config for just one domain, checkout the document here. You can do:

- /path/to/http_config:/var/lib/nginx-conf/domain.tld.conf.erb:ro
- /path/to/http_config:/var/lib/nginx-conf/domain.tld.ssl.conf.erb:ro

I don't think it has anything to do with - https-portal-data:/var/lib/https-portal.

MarcelWaldvogel commented 2 years ago

You could add the following lines to the CUSTOM_NGINX_DOMAIN_TLD_CONFIG_BLOCK:

  location = / {
    return 307 https://domain.tld/URI/
  }