Skip to content

Conversation

@propheth
Copy link

@propheth propheth commented Feb 25, 2021

Added the REDIRECT environment variable to solve issues #180, #960, #958, #444, #1095 and an alternative to #1369.
Should work for both HTTP and HTTPS, depending on what is configured and perform a single redirect.

The config below does non-www to www,

environment:
    - VIRTUAL_HOST: test.com,www.test.com,a.test.com
    - REDIRECT: www.test.com
    - LETSENCRYPT_HOST: test.com,www.test.com,a.test.com

will create the 301 redirects below

test.com -> www.test.com
a.test.com -> www.test.com

The config below does www to non-www,

environment:
    - VIRTUAL_HOST: test.com,www.test.com,a.test.com
    - REDIRECT: test.com
    - LETSENCRYPT_HOST: test.com,www.test.com,a.test.com

will create the 301 redirects below

www.test.com -> test.com
a.test.com -> test.com

@buchdag buchdag added kind/feature-request Issue requesting a new feature status/pr-needs-tests This PR needs new or additional test(s) labels Mar 17, 2021
@alekna
Copy link
Contributor

alekna commented Apr 3, 2021

How about:

  • making redirect code configurable
  • if not configured, making HTTP/302 a default redirect code

@buchdag buchdag added type/feat PR for a new feature and removed kind/feature-request Issue requesting a new feature labels Apr 29, 2021
@coaperator
Copy link

When is the merger of this PR, #1836 and #1927 planned?

@buchdag buchdag added the scope/host-aliases Issue or PR related to alias redirection label Dec 26, 2022
@R0Wi
Copy link
Contributor

R0Wi commented Jul 13, 2023

@buchdag would you like to see such a feature in this product? If yes, I can provide a conflict resolution for this PR and add appropriate tests. Just let me know 👍

@buchdag
Copy link
Member

buchdag commented Jul 13, 2023

@R0Wi if documented and tested, yes I'd like to see this feature merged 👍

@Langsdorf
Copy link

@R0Wi hey, any updates on this pr?

@CarlosTorrecillas
Copy link

Thanks for this! I am using it right now and it works like a charm. I had to update it a little bit because the template itself has been updated but the essence is great. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/host-aliases Issue or PR related to alias redirection status/pr-needs-tests This PR needs new or additional test(s) type/feat PR for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants