server { listen 80; server_name sogo.junge-piraten.de; rewrite ^/$ /SOGo; # Ugly bugfix: SOGo gives wrong CalDAV-Paths (due to having // instead of / in Calendar-Properties URL) # Reported as #2449: http://sogo.nu/bugs/view.php?id=2449 rewrite ^/SOGo/so/dav(.*)$ /SOGo/dav$1; location ^~/SOGo { proxy_pass http://127.0.0.1:20000/SOGo; proxy_redirect http://127.0.0.1:20000/SOGo default; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header x-webobjects-server-name "sogo.junge-piraten.de"; proxy_set_header x-webobjects-server-url "https://sogo.junge-piraten.de"; proxy_set_header x-webobjects-server-protocol HTTP/1.0; proxy_set_header x-webobjects-remote-host 127.0.0.1; } location /SOGo.woa/WebServerResources/ { alias /usr/lib/GNUstep/SOGo/WebServerResources/; allow all; } location /.woa/WebServerResources/ { alias /usr/lib/GNUstep/SOGo/WebServerResources/; allow all; } location /SOGo/WebServerResources/ { alias /usr/lib/GNUstep/SOGo/WebServerResources/; allow all; } location ^/SOGo/so/ControlPanel/Products/([^/]*)/Resources/(.*)$ { alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2; } location ^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$ { alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2; } }