2020 {% if matrix_nginx_proxy_floc_optout_enabled %}
2121 add_header Permissions-Policy interest-cohort=() always;
2222 {% endif %}
23-
23+
2424 {% if matrix_nginx_proxy_hsts_preload_enabled %}
2525 add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
2626 {% else %}
2727 add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
2828 {% endif %}
29-
29+
3030 add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";
3131
3232 location /.well-known/matrix {
5959
6060 proxy_set_header Host $host;
6161 proxy_set_header X-Forwarded-For $remote_addr;
62- proxy_set_header X-Forwarded-Proto $scheme ;
62+ proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }} ;
6363 }
6464 {% endif %}
6565
7777
7878 proxy_set_header Host $host;
7979 proxy_set_header X-Forwarded-For $remote_addr;
80- proxy_set_header X-Forwarded-Proto $scheme ;
80+ proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }} ;
8181 }
8282 {% endif %}
8383
112112
113113 proxy_set_header Host $host;
114114 proxy_set_header X-Forwarded-For $remote_addr;
115- proxy_set_header X-Forwarded-Proto $scheme ;
115+ proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }} ;
116116 }
117117 {% endif %}
118118
137137
138138 proxy_set_header Host $host;
139139 proxy_set_header X-Forwarded-For $remote_addr;
140- proxy_set_header X-Forwarded-Proto $scheme ;
140+ proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }} ;
141141
142142 client_body_buffer_size 25M;
143143 client_max_body_size {{ matrix_nginx_proxy_proxy_matrix_client_api_client_max_body_size_mb }}M;
152152 #}
153153 location ~* ^/$ {
154154 {% if matrix_nginx_proxy_proxy_matrix_client_redirect_root_uri_to_domain %}
155- return 302 $scheme ://{{ matrix_nginx_proxy_proxy_matrix_client_redirect_root_uri_to_domain }}$request_uri;
155+ return 302 {{ matrix_nginx_proxy_x_forwarded_proto_value }} ://{{ matrix_nginx_proxy_proxy_matrix_client_redirect_root_uri_to_domain }}$request_uri;
156156 {% else %}
157157 rewrite ^/$ /_matrix/static/ last;
158158 {% endif %}
@@ -215,12 +215,12 @@ server {
215215 ssl_stapling_verify on;
216216 ssl_trusted_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_matrix_hostname }}/chain.pem;
217217 {% endif %}
218-
218+
219219 {% if matrix_nginx_proxy_ssl_session_tickets_off %}
220220 ssl_session_tickets off;
221221 {% endif %}
222222 ssl_session_cache {{ matrix_nginx_proxy_ssl_session_cache }};
223- ssl_session_timeout {{ matrix_nginx_proxy_ssl_session_timeout }};
223+ ssl_session_timeout {{ matrix_nginx_proxy_ssl_session_timeout }};
224224
225225 {{ render_vhost_directives() }}
226226}
@@ -262,7 +262,7 @@ server {
262262 ssl_stapling_verify on;
263263 ssl_trusted_certificate {{ matrix_nginx_proxy_proxy_matrix_federation_api_ssl_trusted_certificate }};
264264 {% endif %}
265-
265+
266266 {% if matrix_nginx_proxy_ssl_session_tickets_off %}
267267 ssl_session_tickets off;
268268 {% endif %}
@@ -283,7 +283,7 @@ server {
283283
284284 proxy_set_header Host $host;
285285 proxy_set_header X-Forwarded-For $remote_addr;
286- proxy_set_header X-Forwarded-Proto $scheme ;
286+ proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }} ;
287287
288288 client_body_buffer_size 25M;
289289 client_max_body_size {{ matrix_nginx_proxy_proxy_matrix_federation_api_client_max_body_size_mb }}M;
0 commit comments