http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; sendfile on; keepalive_timeout 65; gzip on; error_log /var/log/nginx/http_error.log error; access_log /var/log/nginx/http_access.log; server { listen 80; server_name webmail.potensol.com; root /usr/local/GNUstep/Local/Library/SOGo/WebServerResources-potensol.com/; ## requirement to create new calendars in Thunderbird ## proxy_http_version 1.1; error_log /var/log/nginx/webmail.potensol.com_error.log error; access_log /var/log/nginx/webmail.potensol.com_access.log; location = / { rewrite ^ http://$server_name/SOGo; allow all; } # For IOS 7 location = /principals/ { rewrite ^ http://$server_name/SOGo/dav; allow all; } location /plugins { alias /usr/local/GNUstep/Local/Library/SOGo/plugins/; } location /plugins/updates.php { root html; fastcgi_pass 192.168.10.5:9000; fastcgi_index updates.php; fastcgi_param SCRIPT_FILENAME /usr/local/GNUstep/Local/Library/SOGo/plugins/updates.php; include /usr/local/etc/nginx/fastcgi_params; } location ^~/SOGo { proxy_pass http://192.168.10.5:20000; proxy_redirect http://192.168.10.5:20000 default; # 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; proxy_set_header x-webobjects-server-protocol HTTP/1.0; proxy_set_header x-webobjects-remote-host 192.168.10.5; proxy_set_header x-webobjects-server-name $server_name; proxy_set_header x-webobjects-server-url $scheme://$host; proxy_set_header x-webobjects-server-port $server_port; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; client_max_body_size 50m; client_body_buffer_size 128k; break; } location /SOGo.woa/WebServerResources/ { alias /usr/local/GNUstep/Local/Library/SOGo/WebServerResources-potensol.com/; allow all; } location /SOGo/WebServerResources/ { alias /usr/local/GNUstep/Local/Library/SOGo/WebServerResources-potensol.com/; allow all; } location (^/SOGo/so/ControlPanel/Products/([^/]*)/Resources/(.*)$) { alias /usr/local/GNUstep/Local/Library/SOGo/$1.SOGo/Resources/$2; } location (^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$) { alias /usr/local/GNUstep/Local/Library/SOGo/$1.SOGo/Resources/$2; } } ... ... Another server entry for another domain ... ... }