Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- server_name {% $NAME %} [% $ALIASES %];
- ssl on;
- ssi on;
- ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
- ssl_prefer_server_ciphers on;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- {% if $HSTS == on %}
- add_header Strict-Transport-Security "max-age=31536000;";
- {% endif %}
- {% if $SSL_DHPARAM == 2048 %}
- ssl_dhparam /etc/ssl/certs/dhparam2048.pem;
- {% elif $SSL_DHPARAM == 4096 %}
- ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
- {% endif %}
- charset [% $CHARSET %];
- {% if $DIRINDEX != "" %}
- index [% $DIRINDEX %];
- {% endif %}
- disable_symlinks if_not_owner from=$root_path;
- include {% $NGINX_VHOST_INCLUDES %};
- include {% $INCLUDE_RESOURCE_PATH %};
- {% if $LOG_ACCESS == on %}
- access_log [% $ACCESS_LOG_PATH %];
- {% elif $NO_TRAFF_COUNT == on %}
- access_log off;
- {% endif %}
- {% if $LOG_ERROR == on %}
- error_log {% $ERROR_LOG_PATH %} notice;
- {% else %}
- error_log /dev/null crit;
- {% endif %}
- {% if $SSI == on %}
- ssi on;
- {% endif %}
- set $root_path {% $VIRTUAL_DOCROOT %};
- {% if $AUTOSUBDOMAIN != off and $AUTOSUBDOMAIN != "" %}
- {% if $AUTOSUBDOMAIN == autosubdomain_subdir %}
- set $subdomain "";
- {% elif $AUTOSUBDOMAIN == autosubdomain_dir %}
- set $subdomain {% $AUTOSUBDOMAIN_SUBDOMAIN_PART %};
- {% endif %}
- if ($host ~* ^((.*).{% $NAME %})$) {
- {% if $AUTOSUBDOMAIN == autosubdomain_dir %}
- set $subdomain $1;
- {% elif $AUTOSUBDOMAIN == autosubdomain_subdir %}
- set $subdomain $2;
- {% endif %}
- }
- root $root_path/$subdomain;
- {% else %}
- root $root_path;
- {% endif %}
- {% if $HTTP2_ON == on %}
- {% if $FOREGROUND == on %}
- listen {% $NGINX_SSL_LISTEN_ON %} default_server http2;
- {% else %}
- listen {% $NGINX_SSL_LISTEN_ON %} http2;
- {% endif %}
- {% else %}
- {% if $FOREGROUND == on %}
- listen {% $NGINX_SSL_LISTEN_ON %} default_server;
- {% else %}
- listen {% $NGINX_SSL_LISTEN_ON %};
- {% endif %}
- {% endif %}
- {% if $USER_RESOURCES %}
- include {% $USER_NGINX_RESOURCES_PATH %};
- {% endif %}
- {% if $SRV_GZIP == on %}
- gzip on;
- gzip_comp_level [% $GZIP_LEVEL %];
- gzip_disable "msie6";
- gzip_types [% $GZIP_TYPES %];
- {% endif %}
- {% if $REDIRECT_TO_APACHE != on and $SRV_CACHE == on %}
- expires [% $EXPIRES_VALUE %];
- {% endif %}
- location / {
- {% if $PHP == on %}
- location ~ [^/]\.ph(p\d*|tml)$ {
- {% if $PHP_MODE == php_mode_fcgi_nginxfpm %}
- try_files /does_not_exists @php;
- {% else %}
- try_files /does_not_exists @fallback;
- {% endif %}
- }
- {% endif %}
- {% if $REDIRECT_TO_APACHE == on %}
- location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
- {% if $SRV_CACHE == on %}
- expires [% $EXPIRES_VALUE %];
- {% endif %}
- try_files $uri $uri/ @fallback;
- }
- location / {
- try_files /does_not_exists @fallback;
- }
- {% endif %}
- }
- {% if $ANALYZER != off and $ANALYZER != "" %}
- location {% $WEBSTAT_LOCATION %} {
- charset [% $WEBSTAT_ENCODING %];
- index index.html;
- {% if $PHP == on %}
- location ~ [^/]\.ph(p\d*|tml)$ {
- {% if $PHP_MODE == php_mode_fcgi_nginxfpm %}
- try_files /does_not_exists @php;
- {% else %}
- try_files /does_not_exists @fallback;
- {% endif %}
- }
- {% endif %}
- {% if $REDIRECT_TO_APACHE == on %}
- location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
- {% if $SRV_CACHE == on %}
- expires [% $EXPIRES_VALUE %];
- {% endif %}
- try_files $uri $uri/ @fallback;
- }
- location {% $WEBSTAT_LOCATION %} {
- try_files /does_not_exists @fallback;
- }
- {% endif %}
- }
- {% endif %}
- {% if $REDIRECT_TO_APACHE == on %}
- location @fallback {
- proxy_pass {% $BACKEND_BIND_URI %};
- proxy_redirect {% $BACKEND_BIND_URI %} /;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Forwarded-Port $server_port;
- {% if $NO_TRAFF_COUNT == on %}
- access_log off;
- {% endif %}
- }
- {% endif %}
- {% if $REDIRECT_TO_PHPFPM == on %}
- location @php {
- fastcgi_index index.php;
- fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f {% $EMAIL %}";
- fastcgi_pass {% $PHPFPM_USER_SOCKET_PATH %};
- fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
- try_files $uri =404;
- include fastcgi_params;
- }
- {% endif %}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement