# # Run SOGo as a sub-domain virtual host. # root PH_SOGO_GNUSTEP_DIR/WebServerResources; location / { rewrite ^ https://$host/SOGo; } # For Mac OS X and iOS devices. rewrite ^/.well-known/caldav /SOGo/dav permanent; rewrite ^/.well-known/carddav /SOGo/dav permanent; rewrite ^/principals /SOGo/dav permanent; include PH_NGINX_CONF_TMPL_DIR/hsts.tmpl; location ^~ /SOGo { proxy_pass http://PH_SOGO_BIND_ADDRESS:PH_SOGO_BIND_PORT; # forward user's IP address proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; # always use https proxy_set_header x-webobjects-server-port $server_port; proxy_set_header x-webobjects-server-name $host; proxy_set_header x-webobjects-server-url https://$host; proxy_set_header x-webobjects-server-protocol HTTP/1.0; } location ^~ /Microsoft-Server-ActiveSync { proxy_pass http://PH_SOGO_BIND_ADDRESS:PH_SOGO_BIND_PORT/SOGo/Microsoft-Server-ActiveSync; proxy_connect_timeout PH_SOGO_PROXY_TIMEOUT; proxy_send_timeout PH_SOGO_PROXY_TIMEOUT; proxy_read_timeout PH_SOGO_PROXY_TIMEOUT; } location ^~ /SOGo/Microsoft-Server-ActiveSync { proxy_pass http://PH_SOGO_BIND_ADDRESS:PH_SOGO_BIND_PORT/SOGo/Microsoft-Server-ActiveSync; proxy_connect_timeout PH_SOGO_PROXY_TIMEOUT; proxy_send_timeout PH_SOGO_PROXY_TIMEOUT; proxy_read_timeout PH_SOGO_PROXY_TIMEOUT; } location /SOGo.woa/WebServerResources/ { alias PH_SOGO_GNUSTEP_DIR/WebServerResources/; expires max; } location /SOGo/WebServerResources/ { alias PH_SOGO_GNUSTEP_DIR/WebServerResources/; expires max; } location ^/SOGo/so/ControlPanel/Products/([^/]*)/Resources/(.*)$ { alias PH_SOGO_GNUSTEP_DIR/$1.SOGo/Resources/$2; expires max; } location (^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$) { alias PH_SOGO_GNUSTEP_DIR/$1.SOGo/Resources/$2; expires max; }