Commit c175e13a authored by Manfred Kutas's avatar Manfred Kutas

ZP-1161 Changed configuration to Microsoft-Server-ActiveSync and

autodiscover locations only. Pre-configured SSL and PHP-FPM settings.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 1d476889
server { server {
listen 443 ssl; server_name localhost; # Put your server name
server_name localhost; # Please edit me
# Uncomment the following lines to enable SSL support if not configured yet
ssl on; #listen 443 ssl;
ssl_certificate <path-to-certificate>/fullchain.pem; # Please edit me #listen [::]:443 ssl;
ssl_certificate_key <path-to-certificate>/privkey.pem; # Please edit me #ssl on;
#ssl_certificate /path/to/ssl.crt; # Put in the correct path
root /usr/share/z-push; #ssl_certificate_key /path/to/ssl.key; # Put in the correct path
index index.php;
# If you're using PHP-FPM uncomment the following lines.
access_log /var/log/nginx/zpush-access.log; #include fastcgi_params;
error_log /var/log/nginx/zpush-error.log; #fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# Attachments ca 15MB max (since binary data needs to be base64 encoded in mine, which results in in about 33% overhead) #fastcgi_param REQUEST_URI $1;
client_max_body_size 20m; #fastcgi_param PHP_FLAG "magic_quotes_gpc=off \n register_globals=off \n magic_quotes_runtime=off \n short_open_tag=on";
client_body_buffer_size 128k; #fastcgi_param PHP_VALUE "post_max_size=20M \n upload_max_filesize=20M \n max_execution_time=3660";
#fastcgi_param HTTP_PROXY ""; # Mitigate https://httpoxy.org/ vulnerabilities
location / { #fastcgi_read_timeout 3660; # Z-Push Ping might run 3600s, but to be safe
try_files $uri $uri/ index.php;
location ~* /Microsoft-Server-ActiveSync {
alias /usr/share/z-push/index.php;
access_log /var/log/nginx/z-push-access.log;
error_log /var/log/nginx/z-push-error.log;
# Attachments ca 15MB max (since binary data needs to be base64 encoded in mine, which results in in about 33% overhead)
client_max_body_size 20m;
client_body_buffer_size 128k;
# Select one of the fastcgi_pass values or adapt to your configuration
#fastcgi_pass unix:/var/run/php5-fpm.sock; # for PHP 5.X Debian/Ubuntu
#fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; # for PHP 7.X Debian/Ubuntu
#fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; # usually RedHat and its derivatives
#fastcgi_pass 127.0.0.1:9000; # default php-fpm config
} }
location /Microsoft-Server-ActiveSync { location ~* /AutoDiscover/AutoDiscover.xml {
rewrite ^(.*)$ /index.php last; alias /usr/share/z-push/autodiscover/autodiscover.php;
}
location /AutoDiscover/AutoDiscover.xml {
alias /usr/share/z-push/autodiscover/autodiscover.php;
include fastcgi_params;
#depending on your php-fpm config
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME /usr/share/z-push/autodiscover/autodiscover.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REQUEST_URI $1;
}
location ~ .php$ { access_log /var/log/nginx/z-push-autodiscover-access.log;
include /etc/nginx/fastcgi_params; error_log /var/log/nginx/z-push-autodiscover-error.log;
fastcgi_index index.php;
fastcgi_param HTTPS on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#depending on your php-fpm config # Select one of the fastcgi_pass values or adapt to your configuration
fastcgi_pass unix:/run/php-fpm/php-fpm.sock; #fastcgi_pass unix:/var/run/php5-fpm.sock; # for PHP 5.X Debian/Ubuntu
#fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; # for PHP 7.X Debian/Ubuntu
#fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; # usually RedHat and its derivatives
#fastcgi_pass 127.0.0.1:9000; # default php-fpm config
# PHP max_execution_time is set to 3600 (max heartbeat interval defined in the AS spec is 59 minutes) #fastcgi_index autodiscover.php;
fastcgi_read_timeout 3600;
proxy_read_timeout 3540;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment