Skip to content

Commit da2e877

Browse files
TafkaMaxTaavi Ansper
andauthored
Add full IP chain for getting real IP of user in the element UI. (#24)
* Add X-Real-IP to workers nginx config * Use SYNAPSE_VERSION variable for pulling synapse * Add X-Real-IP also to workers config * use real_ip_recursive on for IP * Use proxy_add_x_forwarded_for for full chain of IP-s * Remove random line * Revert SYNAPSE_VERSION in dockerfile --------- Co-authored-by: Taavi Ansper <taavi.ansper@cyber.ee>
1 parent 5227eaf commit da2e877

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

conf-workers/synapse-nginx.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ server {
9393
# This is proxied into the upstream defined above to take advantage of
9494
# features inherent from HTTP 1.1
9595
proxy_pass http://main_synapse_process;
96-
proxy_set_header X-Forwarded-For $remote_addr;
96+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
9797
proxy_set_header X-Forwarded-Proto $scheme;
9898
proxy_set_header Host $host;
9999
{% if config.keepalive_global_enable %}

configure_workers_and_start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@
355355
NGINX_LOCATION_CONFIG_BLOCK = """
356356
location ~* {endpoint} {{
357357
proxy_pass {upstream};
358-
proxy_set_header X-Forwarded-For $remote_addr;
358+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
359359
proxy_set_header X-Forwarded-Proto $scheme;
360360
proxy_set_header Host $host;
361361
{additional_location_body}

0 commit comments

Comments
 (0)