user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/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"'; access_log /var/log/nginx/access.log main; error_log /var/log/nginx/error.log; sendfile on; #tcp_nopush on; keepalive_timeout 65; gzip off; server { listen 80 default; root /usr/local/lib/GNUstep/SOGo/WebServerResources/; ## requirement to create new calendars in Thunderbird ## proxy_http_version 1.1; location = / { return 301 $scheme://$server_name/SOGo; allow all; } # For IOS 7 location = /principals/ { rewrite ^ `https://$server_name/SOGo/dav`; allow all; } location ^~/SOGo { proxy_pass http://sogo:20000; proxy_redirect `http://sogo: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 127.0.0.1; 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/lib/GNUstep/SOGo/WebServerResources/; allow all; } location /SOGo/WebServerResources/ { alias /usr/local/lib/GNUstep/SOGo/WebServerResources/; allow all; } location (^/SOGo/so/ControlPanel/Products/([^/]*)/Resources/(.*)$) { alias /usr/local/lib/GNUstep/SOGo/$1.SOGo/Resources/$2; } location (^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$) { alias /usr/local/lib/GNUstep/SOGo/$1.SOGo/Resources/$2; } } }