When using nginx as a reverse proxy with proxy_pass, which also provides SSL, it appears that most upstream web servers don't even need to know that they are behind a reverse proxy, or that they are accessed over HTTPS rather than HTTP - they just work.
What I'm curious about is this: at what point are hyperlinks changed? If my web server at example.com returns a page with a hyperlink to http://www.example.com/some_page, when it gets to the browser, the hyperlink appears as https://www.example.com/some_page. How does that happen?
My normal setup is to have the upstream server also running nginx, and pass requests to django. I never really thought about it until now. Does the reverse proxy change the hyperlinks? Does the client's browser? Does the upstream nginx server? Does django? What happens if the hyperlink is in a .js file? Is there any chance whatever is changing these hyperlinks messes up, and breaks the code? How would it know that it's a hyperlink, and not just text on the page that I don't want changed?