I'm dealing with a minor information disclosure when using nginx with onions. Servervault.com might be better suited for an nginx question, but I'm not sure a lot of those guys understand onions or the importance of anonymity, so I'm coming here first.
http://myonionsite.onion/directory/
With /
at the very end does not disclose any server-side info.
http://myonionsite.onion/directory
Without /
at the end, returns this address in the URL bar:
http://myonionsite.onion:18080/directory/
18080
being the tor forwarding port. My nginx server is bind to 127.0.0.1 so the website isn't public facing. The http error page (I think it's a 301) doesn't disclose any info beyond that, I don't think -- making this disclosure very minor but still I would like to resolve it.
I played around with rewrites like:
rewrite ^/directory(.*)$ http://myonionsite.onion redirect;
This kinda worked but I found it caused 302 errors with other elements on my site, such as /logo.png
-- which I found bizarre and confusing.
What's the proper way to deal with something like this?
/directory
requests should be indication enough that I am indeed modifying the nginx.conf and using nginx – user18043 Jun 23 '17 at 9:51