Skip to content

How to use SOGo with Nginx and Basic authentication

Andreas Vögele edited this page Aug 17, 2022 · 1 revision

If you would like to log into your SOGo groupware server with Basic authentication, set the headers x-webobjects-auth-type and x-webobjects-remote-user in your Nginx configuration. Then enable SOGoTrustProxyAuthentication in /etc/sogo/sogo.conf.

location = /auth {
    internal;
    proxy_pass http://unix:/run/nginx-auth/saslauthd.sock:/auth-basic;
    proxy_pass_request_body off;
    proxy_set_header Content-Length "";
    proxy_set_header X-Realm "Private Area";
}

location /SOGo {
    auth_request /auth;
    proxy_pass http://127.0.0.1:20000;
    include proxy_params;
    proxy_buffer_size 8k;
    proxy_buffers 4 64k;
    proxy_set_header x-webobjects-auth-type Basic;
    proxy_set_header x-webobjects-remote-user $remote_user;
    proxy_set_header x-webobjects-server-port 443;
    proxy_set_header x-webobjects-server-name $host;
    proxy_set_header x-webobjects-server-url https://$host;

    location /SOGo.woa/WebServerResources/ {
        alias /usr/lib/GNUstep/SOGo/WebServerResources/;
    }

    location /SOGo/WebServerResources/ {
        alias /usr/lib/GNUstep/SOGo/WebServerResources/;
    }

    location ~ ^/SOGo/so/ControlPanel/Products/(.*)/Resources/(.*)$ {
        alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
    }
}

location /.well-known/caldav {
    return 301 /SOGo/dav;
}

location /.well-known/carddav {
    return 301 /SOGo/dav;
}