Advertisement
Guest User

Untitled

a guest
Aug 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.05 KB | None | 0 0
  1. server {
  2. server_name {% $NAME %} [% $ALIASES %];
  3. ssl on;
  4. ssi on;
  5. ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
  6. ssl_prefer_server_ciphers on;
  7. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  8. {% if $HSTS == on %}
  9. add_header Strict-Transport-Security "max-age=31536000;";
  10. {% endif %}
  11. {% if $SSL_DHPARAM == 2048 %}
  12. ssl_dhparam /etc/ssl/certs/dhparam2048.pem;
  13. {% elif $SSL_DHPARAM == 4096 %}
  14. ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
  15. {% endif %}
  16. charset [% $CHARSET %];
  17. {% if $DIRINDEX != "" %}
  18. index [% $DIRINDEX %];
  19. {% endif %}
  20. disable_symlinks if_not_owner from=$root_path;
  21. include {% $NGINX_VHOST_INCLUDES %};
  22. include {% $INCLUDE_RESOURCE_PATH %};
  23. {% if $LOG_ACCESS == on %}
  24. access_log [% $ACCESS_LOG_PATH %];
  25. {% elif $NO_TRAFF_COUNT == on %}
  26. access_log off;
  27. {% endif %}
  28. {% if $LOG_ERROR == on %}
  29. error_log {% $ERROR_LOG_PATH %} notice;
  30. {% else %}
  31. error_log /dev/null crit;
  32. {% endif %}
  33. {% if $SSI == on %}
  34. ssi on;
  35. {% endif %}
  36. set $root_path {% $VIRTUAL_DOCROOT %};
  37. {% if $AUTOSUBDOMAIN != off and $AUTOSUBDOMAIN != "" %}
  38. {% if $AUTOSUBDOMAIN == autosubdomain_subdir %}
  39. set $subdomain "";
  40. {% elif $AUTOSUBDOMAIN == autosubdomain_dir %}
  41. set $subdomain {% $AUTOSUBDOMAIN_SUBDOMAIN_PART %};
  42. {% endif %}
  43. if ($host ~* ^((.*).{% $NAME %})$) {
  44. {% if $AUTOSUBDOMAIN == autosubdomain_dir %}
  45. set $subdomain $1;
  46. {% elif $AUTOSUBDOMAIN == autosubdomain_subdir %}
  47. set $subdomain $2;
  48. {% endif %}
  49. }
  50. root $root_path/$subdomain;
  51. {% else %}
  52. root $root_path;
  53. {% endif %}
  54. {% if $HTTP2_ON == on %}
  55. {% if $FOREGROUND == on %}
  56. listen {% $NGINX_SSL_LISTEN_ON %} default_server http2;
  57. {% else %}
  58. listen {% $NGINX_SSL_LISTEN_ON %} http2;
  59. {% endif %}
  60. {% else %}
  61. {% if $FOREGROUND == on %}
  62. listen {% $NGINX_SSL_LISTEN_ON %} default_server;
  63. {% else %}
  64. listen {% $NGINX_SSL_LISTEN_ON %};
  65. {% endif %}
  66. {% endif %}
  67. {% if $USER_RESOURCES %}
  68. include {% $USER_NGINX_RESOURCES_PATH %};
  69. {% endif %}
  70. {% if $SRV_GZIP == on %}
  71. gzip on;
  72. gzip_comp_level [% $GZIP_LEVEL %];
  73. gzip_disable "msie6";
  74. gzip_types [% $GZIP_TYPES %];
  75. {% endif %}
  76. {% if $REDIRECT_TO_APACHE != on and $SRV_CACHE == on %}
  77. expires [% $EXPIRES_VALUE %];
  78. {% endif %}
  79. location / {
  80. {% if $PHP == on %}
  81. location ~ [^/]\.ph(p\d*|tml)$ {
  82. {% if $PHP_MODE == php_mode_fcgi_nginxfpm %}
  83. try_files /does_not_exists @php;
  84. {% else %}
  85. try_files /does_not_exists @fallback;
  86. {% endif %}
  87. }
  88. {% endif %}
  89. {% if $REDIRECT_TO_APACHE == on %}
  90. location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  91. {% if $SRV_CACHE == on %}
  92. expires [% $EXPIRES_VALUE %];
  93. {% endif %}
  94. try_files $uri $uri/ @fallback;
  95. }
  96. location / {
  97. try_files /does_not_exists @fallback;
  98. }
  99. {% endif %}
  100. }
  101. {% if $ANALYZER != off and $ANALYZER != "" %}
  102. location {% $WEBSTAT_LOCATION %} {
  103. charset [% $WEBSTAT_ENCODING %];
  104. index index.html;
  105. {% if $PHP == on %}
  106. location ~ [^/]\.ph(p\d*|tml)$ {
  107. {% if $PHP_MODE == php_mode_fcgi_nginxfpm %}
  108. try_files /does_not_exists @php;
  109. {% else %}
  110. try_files /does_not_exists @fallback;
  111. {% endif %}
  112. }
  113. {% endif %}
  114. {% if $REDIRECT_TO_APACHE == on %}
  115. location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  116. {% if $SRV_CACHE == on %}
  117. expires [% $EXPIRES_VALUE %];
  118. {% endif %}
  119. try_files $uri $uri/ @fallback;
  120. }
  121. location {% $WEBSTAT_LOCATION %} {
  122. try_files /does_not_exists @fallback;
  123. }
  124. {% endif %}
  125. }
  126. {% endif %}
  127. {% if $REDIRECT_TO_APACHE == on %}
  128. location @fallback {
  129. proxy_pass {% $BACKEND_BIND_URI %};
  130. proxy_redirect {% $BACKEND_BIND_URI %} /;
  131. proxy_set_header Host $host;
  132. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  133. proxy_set_header X-Forwarded-Proto $scheme;
  134. proxy_set_header X-Forwarded-Port $server_port;
  135. {% if $NO_TRAFF_COUNT == on %}
  136. access_log off;
  137. {% endif %}
  138. }
  139. {% endif %}
  140. {% if $REDIRECT_TO_PHPFPM == on %}
  141. location @php {
  142. fastcgi_index index.php;
  143. fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f {% $EMAIL %}";
  144. fastcgi_pass {% $PHPFPM_USER_SOCKET_PATH %};
  145. fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
  146. try_files $uri =404;
  147. include fastcgi_params;
  148. }
  149. {% endif %}
  150. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement