Commit 6623aeba authored by omega8cc's avatar omega8cc

Issue #1552228 by omega8cc - Nginx configuration for limit_conn should be...

Issue #1552228 by omega8cc - Nginx configuration for limit_conn should be compatible with version >= 1.1.8
parent 91efa9c7
......@@ -70,7 +70,15 @@
## General Options
ignore_invalid_headers on;
limit_zone gulag $binary_remote_addr 10m;
<?php
$nginx_is_modern = drush_get_option('nginx_is_modern');
if ($nginx_is_modern) {
print " limit_conn_zone \$binary_remote_addr zone=gulag:10m;\n";
}
else {
print " limit_zone gulag \$binary_remote_addr 10m;\n";
}
?>
recursive_error_pages on;
reset_timedout_connection on;
fastcgi_intercept_errors on;
......
......@@ -15,6 +15,7 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
$this->server->setProperty('nginx_has_gzip', 0);
$this->server->setProperty('nginx_web_server', 0);
$this->server->setProperty('nginx_has_upload_progress', 0);
$this->server->setProperty('nginx_is_modern', 0);
}
function save_server() {
......@@ -34,8 +35,9 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
// Check if some nginx features are supported and save them for later.
$this->server->shell_exec($path . ' -V');
$this->server->nginx_is_modern = preg_match("/nginx\/1\.((1\.(8|9|(1[0-9]+)))|(2\.))/", implode('', drush_shell_exec_output()), $match);
$this->server->nginx_has_upload_progress = preg_match("/upload/", implode('', drush_shell_exec_output()), $match);
$this->server->nginx_has_gzip = preg_match("/(with-http_gzip_static_module)/", implode('', drush_shell_exec_output()), $match);
$this->server->nginx_has_gzip = preg_match("/http_gzip_static_module/", implode('', drush_shell_exec_output()), $match);
$this->server->provision_db_cloaking = FALSE;
$this->server->nginx_web_server = 1;
}
......
......@@ -35,6 +35,7 @@ class Provision_Service_http_nginx_ssl extends Provision_Service_http_ssl {
$this->server->setProperty('nginx_has_gzip', 0);
$this->server->setProperty('nginx_web_server', 0);
$this->server->setProperty('nginx_has_upload_progress', 0);
$this->server->setProperty('nginx_is_modern', 0);
}
function save_server() {
......@@ -54,8 +55,9 @@ class Provision_Service_http_nginx_ssl extends Provision_Service_http_ssl {
// Check if some nginx features are supported and save them for later.
$this->server->shell_exec($path . ' -V');
$this->server->nginx_is_modern = preg_match("/nginx\/1\.((1\.(8|9|(1[0-9]+)))|(2\.))/", implode('', drush_shell_exec_output()), $match);
$this->server->nginx_has_upload_progress = preg_match("/upload/", implode('', drush_shell_exec_output()), $match);
$this->server->nginx_has_gzip = preg_match("/(with-http_gzip_static_module)/", implode('', drush_shell_exec_output()), $match);
$this->server->nginx_has_gzip = preg_match("/http_gzip_static_module/", implode('', drush_shell_exec_output()), $match);
$this->server->provision_db_cloaking = FALSE;
$this->server->nginx_web_server = 1;
}
......
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