I have Traefik happily working with numerous services in docker containers and have become curious about also making some of them available for Tor users as onion hidden services.
On a different server using nginx instead of Traefik, I was able to make it work this way: PrivateBin
In the above scenario, a user that browses to example.com via Tor Browser will see the purple ".onion available" banner, clicking it has the corresponding (http://) onion hidden service load.
I've not had any luck in figuring out how to accomplish the same with Traefik. I've seen some guides (Shivering-Isles Onion Service), but they were for older versions of Traefik. Looking at their guide and the current Traefik documentation on headers (Headers - Traefik), I thought something like:
With this, every user that goes to either example.com or tpgzjkhxywpv4qjajqsitx4ywmtdrphjt3crbncfhelsyhfd6sr3w7yd.onion should have the Onion-Location header thus making it ".onion available".
How would I format the middleware configuration you mentioned? How can I make sure that the http-to-https redirect is not applied when the onion address is entered?