Remote Desktop: Difference between revisions

Crazivik (talk | contribs)
mNo edit summary
Fschn90 (talk | contribs)
m tiny fix of syntax in nginx reverse proxy config
 
Line 140: Line 140:


     services.nginx = {
     services.nginx = {
        enable = true;
<nowiki> </nowiki>      enable = true;
        upstreams."guacamole_server" = {
<nowiki> </nowiki>      upstreams."guacamole_server" = {
            extraConfig = ''
<nowiki> </nowiki>          extraConfig = <nowiki>''</nowiki>
                keepalive 4;
<nowiki> </nowiki>              keepalive 4;
            '';
<nowiki> </nowiki>          <nowiki>''</nowiki>'';
            servers = {
<nowiki> </nowiki>          servers = {
                "127.0.0.1:8080" = {};
<nowiki> </nowiki>              "127.0.0.1:8080" = {};
            };
<nowiki> </nowiki>          };
        };
<nowiki> </nowiki>      };
        virtualHosts."remote.mydomain.net" = {
<nowiki> </nowiki>      virtualHosts."remote.mydomain.net" = {
            forceSSL = true; # redirect http to https
<nowiki> </nowiki>          forceSSL = true; # redirect http to https
            enableACME = true;
<nowiki> </nowiki>          enableACME = true;
            locations."/" = {
<nowiki> </nowiki>          locations."/" = {
                extraConfig = ''
<nowiki> </nowiki>              extraConfig = <nowiki>''</nowiki>
                    proxy_buffering off;
<nowiki> </nowiki>                  proxy_buffering off;
                    proxy_set_header Upgrade $http_upgrade;
<nowiki> </nowiki>                  proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection $http_connection;
<nowiki> </nowiki>                  proxy_set_header Connection $http_connection;
                    proxy_set_header X-Real-IP $remote_addr;
<nowiki> </nowiki>                  proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
<nowiki> </nowiki>                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header Host $host;
<nowiki> </nowiki>                  proxy_set_header Host $host;
                    proxy_set_header X-NginX-Proxy true;
<nowiki> </nowiki>                  proxy_set_header X-NginX-Proxy true;
                    proxy_pass http://guacamole_server/guacamole$request_uri;
<nowiki> </nowiki>                  proxy_pass http://guacamole_server/guacamole$request_uri;
                     proxy_redirect http://guacamole_server/ https://$server_name/;
                     proxy_redirect http://guacamole_server/ https://$server_name/;
                '';
<nowiki> </nowiki>              <nowiki>''</nowiki>'';
             };
             };
         };
         };