Add nginx configuration example to pkg README, from giovanni@, with

minor tweak from me.

Feel free to commit, giovanni@
This commit is contained in:
sebastia 2014-05-16 17:00:21 +00:00
parent f6f2a6dbc6
commit f8c6d5c75d
2 changed files with 92 additions and 6 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.37 2014/01/11 12:56:41 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.38 2014/05/16 17:00:21 sebastia Exp $
COMMENT = web based groupware server
VERSION = 2.1.1
DISTNAME = SOGo-${VERSION}b
PKGNAME = sogo-${VERSION}.1
REVISION = 0
REVISION = 1
SHARED_LIBS += GDLContentStore 2.0
SHARED_LIBS += NGCards 2.0

View File

@ -1,4 +1,4 @@
# $OpenBSD: README,v 1.11 2014/01/11 12:56:41 ajacoutot Exp $
# $OpenBSD: README,v 1.12 2014/05/16 17:00:21 sebastia Exp $
+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
@ -19,8 +19,8 @@ over multiple systems, related to your needs:
- Memcached to speed up SOGo:
* install the memcached package
- Web Server:
* you can use httpd from the OpenBSD base system
- or install the apache-httpd package
* you can use nginx from the OpenBSD base system
- or install the apache-httpd-openbsd package
- Database Server:
* install postgresql-server package
- or install mysql-server package
@ -51,7 +51,93 @@ The SOPE PostgreSQL database adaptor is automatically installed.
If you want to use a MySQL database as backend, you have to install
the sope-mysql package on the host where SOPE and SOGo are installed.
SGOo with httpd from OpenBSD base
SOGo with nginx
======================================
Since nginx configuration is not explained in the SOGo Manual, here is an example.
It's assumed that nginx(8) and SOGo run on the same host. Nginx(8) listens on port 80,
and SOGo is listening on its default port 20000.
Nginx runs in a chroot environment on OpenBSD, therefore you have to
copy some files into the server's chroot environment:
# mkdir -p /var/www/lib/sogo
# cp -R ${TRUEPREFIX}/lib/GNUstep/SOGo/WebServerResources /var/www/lib/sogo/www
Edit /etc/nginx/nginx.conf
server {
listen 80;
root /var/www/lib/GNUstep/SOGo/WebServerResources/;
location = /
{
rewrite ^ http://$server_name/SOGo;
allow all;
}
# For IOS 7
location = /principals/
{
rewrite ^ http://$server_name/SOGo/dav;
allow all;
}
location = /.well-known/caldav/
{
rewrite ^ http://$server_name/SOGo/dav;
}
location = /.well-known/carddav/
{
rewrite ^ http://$server_name/SOGo/dav;
allow all;
}
location ^~/SOGo {
proxy_pass http://127.0.0.1:20000;
proxy_redirect http://127.0.0.1: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 /var/www/lib/GNUstep/SOGo/WebServerResources/;
allow all;
}
location /SOGo/WebServerResources/ {
alias /var/www/lib/GNUstep/SOGo/WebServerResources/;
allow all;
}
location ^/SOGo/so/ControlPanel/Products/([^/]*)/Resources/(.*)$ {
alias /var/www/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
}
location ^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$
{
alias /var/www/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
}
}
SOGo with OpenBSD apache-httpd-openbsd package
======================================
Since the httpd 1.3 configuration is slightly different than the Apache 2
configuration explained in the SOGo Manual, here is an example. It's assumed