server {
    server_name localhost; # Put your server name

    # Uncomment the following lines to enable SSL support if not configured yet
    #listen 443 ssl;
    #listen [::]:443 ssl;
    #ssl on;
    #ssl_certificate     /path/to/ssl.crt; # Put in the correct path
    #ssl_certificate_key /path/to/ssl.key; # Put in the correct path

    # If you're using PHP-FPM uncomment the following lines.
    #include         fastcgi_params;
    #fastcgi_index   index.php;
    #fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #fastcgi_param   REQUEST_URI $1;
    #fastcgi_param   PHP_FLAG "magic_quotes_gpc=off \n register_globals=off \n magic_quotes_runtime=off \n short_open_tag=on";
    #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
    #fastcgi_read_timeout 3660; # Z-Push Ping might run 3600s, but to be safe

    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
        include snippets/z-push-php.conf;
    }

    location /AutoDiscover/AutoDiscover.xml {
        include snippets/z-push-autodiscover.conf;
        include snippets/z-push-php.conf;
    }
    location /Autodiscover/Autodiscover.xml {
        include snippets/z-push-autodiscover.conf;
        include snippets/z-push-php.conf;
    }
    location /autodiscover/autodiscover.xml {
        include snippets/z-push-autodiscover.conf;
        include snippets/z-push-php.conf;
    }
}
