[horde] H6 & ActiveSync on NGINX

Brent impuser at bitrealm.com
Fri Apr 11 19:49:02 UTC 2025


  I just tried setting this up with nginx (without SSL) and got it to  
work and sync using an Iphone and ActiveSync (Exchange). I ran the  
nginx process as apache in my test. I set this up such that  
"mail.test.com" goes directly to the Horde installation at  
/var/www/horde/web. One might be able to simplify this config, but it  
wasn't TOO bad. Pay attention to the path to your socket for php-fpm  
location. This is on Fedora...located in /run/php-fpm/www.sock.

Here's the config:

nginx.conf:

user apache;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    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;

    sendfile            on;
    tcp_nopush          on;
    keepalive_timeout   65;
    types_hash_max_size 8192;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

server {
        listen       80;
        server_name  mail.test.com;
        add_header                          strict-transport-security  
"max-age=31536000; includeSubDomains";
        add_header                          x-frame-options            
"sameorigin";
        add_header                          x-xss-protection           
"1; mode=block";
        add_header                          x-content-type-options     
"nosniff";

    root         /var/www/horde/web;
    index                               index.php;

    location / {
       rewrite_log on;
            location /Microsoft-Server-ActiveSync {
            alias /var/www/horde/vendor/horde/horde/rpc.php;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass                unix:/run/php-fpm/www.sock;
            include                     /etc/nginx/horde.fcgi-php.conf;
        }
        location /autodiscover/autodiscover.xml {
            alias /var/www/horde/vendor/horde/horde/rpc.php;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass                unix:/run/php-fpm/www.sock;
            include                     /etc/nginx/horde.fcgi-php.conf;
        }
        location /Autodiscover/Autodiscover.xml {
            alias /var/www/horde/vendor/horde/horde/rpc.php;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass                unix:/run/php-fpm/www.sock;
            include                     /etc/nginx/horde.fcgi-php.conf;
         }
        location ^~ /static/ {
            expires                     4w;
            add_header                  Cache-Control public;
        }
        location ^~ /themes/ {
            expires                     4w;
            add_header                  Cache-Control public;
        }

        location ^~ /services/ajax.php {
            fastcgi_split_path_info     ^(.+\.php)(/.+)$;
            fastcgi_pass                unix:/run/php-fpm/www.sock;
            include                     /etc/nginx/horde.fcgi-php.conf;
        }
        location ~ \.php {
            fastcgi_pass                unix:/run/php-fpm/www.sock;
            include                     /etc/nginx/horde.fcgi-php.conf;
        }

        try_files                       $uri $uri/ /rampage.php?$args;
   }
}

Here's the /etc/nginx/horde.fcgi-php.conf:

fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

Quoting Horst B Simon <horst.simon2 at icloud.com>:

> Hi,
>
> Has anyone Horde 6 and active sync on nginx working and willing to  
> share the nginx configuration for Horde 6?
>
> Thanks and Regards,
> Horst Simon
> --
> Horde mailing list
> Frequently Asked Questions: http://horde.org/faq/To unsubscribe,  
> mail: horde-unsubscribe at lists.horde.org


More information about the horde mailing list