Commit 48c1750f authored by omega8cc's avatar omega8cc

Issue #1442906 by cweagans - Nginx should listen on all supplied IP addresses...

Issue #1442906 by cweagans - Nginx should listen on all supplied IP addresses also on port 80 in all vhosts.
parent a6c324a5
......@@ -4,7 +4,9 @@ if ($ssl_redirection || $this->redirection) {
// Redirect all aliases to the main http url using separate vhosts blocks to avoid if{} in Nginx.
foreach ($this->aliases as $alias_url) {
print "server {\n";
print " listen {$ip_address}:{$http_port};\n";
foreach ($server->ip_addresses as $ip) {
print " listen {$ip}:{$http_port};\n";
}
print " server_name {$alias_url};\n";
print " access_log off;\n";
print " rewrite ^ \$scheme://{$this->uri}\$request_uri? permanent;\n";
......@@ -16,7 +18,9 @@ if ($ssl_redirection || $this->redirection) {
server {
include <?php print "{$server->include_path}"; ?>/fastcgi_params.conf;
limit_conn gulag 18; # like mod_evasive - this allows max 18 simultaneous connections from one IP address
listen <?php print $ip_address . ':' . $http_port; ?>;
<?php foreach ($server->ip_addresses as $ip) :?>
listen <?php print $ip . ':' . $http_port; ?>;
<?php endforeach; ?>
server_name <?php print $this->uri; ?><?php if (!$this->redirection && is_array($this->aliases)) : foreach ($this->aliases as $alias_url) : if (trim($alias_url)) : ?> <?php print $alias_url; ?><?php endif; endforeach; endif; ?>;
root <?php print "{$this->root}"; ?>;
<?php print $extra_config; ?>
......
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