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

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

Open
nunnsby opened this issue Mar 5, 2021 · 2 comments
Open

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

nunnsby opened this issue Mar 5, 2021 · 2 comments

Comments

@nunnsby
Copy link

nunnsby commented Mar 5, 2021

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
Copy link
Owner

SteveLTN commented Mar 6, 2021

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
Copy link
Contributor

You could add the following lines to the CUSTOM_NGINX_DOMAIN_TLD_CONFIG_BLOCK:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants