I've been looking at middleware redirectRegex
schemes in the docs, in the forums and on various blogs, but for whatever reason I can't seem to get my setup working the way I need it to. It appears this shouldn't be that complicated, but I'm clearly not understanding something.
What I'm after is rather simple (I think). I have an app running running on app.example.com and I need to sunset that domain and FQDN. So, I want to redirect app.example.com to app.example.net.
I've tried to put in a redirect in various places, including my config.yml
file, like so:
http:
middlewares:
https-only:
redirectScheme:
scheme: https
permanent: true
...
app-redirect:
redirectRegex:
regex: "^http://app.example.com/(.*)"
replacement: "https://app.example.net/"
permanent: false
I thought this would be all I needed. I've tried some iterations of other regexes, but none have made any difference. The only thing that happens is that if I go to http://app.example.com, I get redirected to https://app.example.com.
If anyone can tell me what I'm doing wrong, I'd greatly appreciate it.
Thanks in advance.