Differences

This shows you the differences between two versions of the page.

Link to this comparison view

fuss:trac [2017/11/25 10:32] (current)
office created
Line 1: Line 1:
 +====== Trac behind Proxy ======
 +
 +Trac uses ''​REMOTE_ADDRESS''​ to determine the client'​s IP address which can mislead the trac spam filters and flag a submission as spam. To change the behaviour, [[https://​trac.edgewall.org/​ticket/​5199|trac can be modified]], to check the ''​X-Real-IP''​ and ''​X-Forwarded-For''​ headers by editing the ''​trac/​web/​standalone.py''​ file in the trac source and rebuilding trac:
 +<​code>​
 +--- trac/​web/​standalone.py.old 2011-12-12 14:​01:​33.546973494 +0000
 ++++ trac/​web/​standalone.py 2011-12-12 14:​00:​50.554973513 +0000
 +@@ -112,6 +112,11 @@
 +     ​server_version = '​tracd/'​ + VERSION
 + 
 +     def address_string(self):​
 ++        # Get remote address of client if tracd is behind a proxy
 ++        ip = self.headers.get("​X-Real-IP"​) or \
 ++             ​self.headers.get("​X-Forwarded-For"​)
 ++        if ip:
 ++            return ip
 +         # Disable reverse name lookups
 +         ​return self.client_address[:​2][0]
 +</​code>​
  

fuss/trac.txt ยท Last modified: 2017/11/25 10:32 by office

Access website using Tor Access website using i2p


For the copyright, license, warranty and privacy terms for the usage of this website please see the license, privacy and plagiarism pages.