Last active
April 12, 2025 18:35
-
-
Save rrei/1dd4337d05620e93f2f8477d7bf2025a to your computer and use it in GitHub Desktop.
Nginx proxy headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # allows django to get the client's IP address (see the ipware module) | |
proxy_set_header X-Forwarded-Proto $scheme; # allows django to determine that the request is secure (see SECURE_PROXY_SSL_HEADER and request.is_secure()) | |
proxy_set_header X-Forwarded-Host $host; # allows django to determine the name/addr of the server that the client originally connected to (see request.get_host()) | |
proxy_set_header X-Forwarded-Port $server_port; # same idea as above, but for port number (see request.get_port()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment