no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| Last revision |
— | fuss:trac [2017/11/25 10:32] – created office |
---|
| ====== 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> |
| |