File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 1313 mkDefault
1414 mkIf
1515 mkOption
16- optional
1716 types
1817 ;
1918in
3736 settings = {
3837 WebService = {
3938 AllowUnencrypted = mkDefault true ;
39+ ProtocolHeader = mkDefault "X-Forwarded-Proto" ;
4040 } ;
4141 Log = {
4242 Fatal = mkDefault "criticals warnings" ;
4545 allowed-origins = [
4646 "http://localhost:${ toString cfg . port } "
4747 "http://${ fqdn } "
48- ]
49- ++ optional ( cfg . forceSSL ) "https://${ fqdn } " ;
48+ "https://${ fqdn } "
49+ "wss://${ fqdn } "
50+ ] ;
5051 } ;
5152
5253 # https://github.com/NixOS/nixpkgs/issues/179676
5657 "${ fqdn } " = {
5758 enableACME = cfg . forceSSL ;
5859 forceSSL = cfg . forceSSL ;
59- locations . "/" . proxyPass = mkDefault "http://localhost:${ toString cfg . port } " ;
60+ locations . "/" = {
61+ proxyPass = mkDefault "http://localhost:${ toString cfg . port } " ;
62+ extraConfig = ''
63+ proxy_set_header Host $host;
64+ proxy_set_header X-Forwarded-Proto $scheme;
65+
66+ # Required for web sockets to function
67+ proxy_http_version 1.1;
68+ proxy_buffering off;
69+ proxy_set_header Upgrade $http_upgrade;
70+ proxy_set_header Connection "upgrade";
71+
72+ # Pass ETag header from Cockpit to clients.
73+ # See: https://github.com/cockpit-project/cockpit/issues/5239
74+ gzip off;
75+ '' ;
76+ } ;
6077 } ;
6178 } ;
6279 } ;
You can’t perform that action at this time.
0 commit comments