matrix-synapse: add recommended proxy config
This commit is contained in:
		| @@ -51,6 +51,14 @@ let | |||||||
|       domain = serverName; |       domain = serverName; | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
|  |   proxyConfig = '' | ||||||
|  |     proxy_set_header        Host $host; | ||||||
|  |     proxy_set_header        X-Real-IP $remote_addr; | ||||||
|  |     proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for; | ||||||
|  |     proxy_set_header        X-Forwarded-Proto $scheme; | ||||||
|  |     proxy_set_header        X-Forwarded-Host $host; | ||||||
|  |     proxy_set_header        X-Forwarded-Server $host; | ||||||
|  |   ''; | ||||||
| in | in | ||||||
| { | { | ||||||
|   networking.firewall.allowedTCPPorts = [ |   networking.firewall.allowedTCPPorts = [ | ||||||
| @@ -100,14 +108,11 @@ in | |||||||
|       locations = { |       locations = { | ||||||
|         "/" = { |         "/" = { | ||||||
|           proxyPass = "http://localhost:8008"; |           proxyPass = "http://localhost:8008"; | ||||||
|           extraConfig = '' |           extraConfig = proxyConfig; | ||||||
|             proxy_set_header X-Forwarded-For $remote_addr; |  | ||||||
|           ''; |  | ||||||
|         }; |         }; | ||||||
|         "/_matrix" = { |         "/_matrix" = { | ||||||
|           proxyPass = "http://localhost:8008"; |           proxyPass = "http://localhost:8008"; | ||||||
|           extraConfig = '' |           extraConfig = proxyConfig + '' | ||||||
|             proxy_set_header X-Forwarded-For $remote_addr; |  | ||||||
|             client_max_body_size 50M; |             client_max_body_size 50M; | ||||||
|           ''; |           ''; | ||||||
|         }; |         }; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user