浏览代码

Pass Host/X-Forwarded-For everywhere

It hasn't mattered much to have these so far, but
it's probably a good idea to have them.
pull/84/head
Slavi Pantaleev 7 年前
父节点
当前提交
fef6c052c3
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. +2
    -1
      roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2
  2. +4
    -0
      roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-synapse.conf.j2

+ 2
- 1
roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-riot-web.conf.j2 查看文件

@@ -50,6 +50,7 @@ server {
proxy_pass http://localhost:8765; proxy_pass http://localhost:8765;
{% endif %} {% endif %}


proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
} }
} }

+ 4
- 0
roles/matrix-nginx-proxy/templates/nginx-conf.d/matrix-synapse.conf.j2 查看文件

@@ -57,6 +57,9 @@ server {
{# Generic configuration for use outside of our container setup #} {# Generic configuration for use outside of our container setup #}
proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_corporal_api_addr_sans_container }}; proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_corporal_api_addr_sans_container }};
{% endif %} {% endif %}

proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
} }
{% endif %} {% endif %}


@@ -109,6 +112,7 @@ server {
proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_client_api_addr_sans_container }}; proxy_pass http://{{ matrix_nginx_proxy_proxy_matrix_client_api_addr_sans_container }};
{% endif %} {% endif %}


proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;


client_body_buffer_size 25M; client_body_buffer_size 25M;


正在加载...
取消
保存