If you install Aegir on Nginx, and edit the server node and add an extra IP address (total of two IP addresses), Nginx will only listen on the first IP address in the list. Instead, Nginx should listen on all supplied IP addresses.

I think this should be something very simple, but I haven't dug into it yet. The root of the problem is that in /var/aegir/config/server_master/nginx/vhost.d/*, there is only one listen directive. I've confirmed that adding another listen directive to those vhost files and restarting nginx will solve the problem, but that change is overwritten upon verifying the site from the Aegir UI.

Comments

omega8cc’s picture

Assigned: Unassigned » omega8cc

The problem is that we don't use wildcard in the Nginx version, like it is used in the Apache version, so extra IPs are never added to the default vhost, however they should work w/o issues in any non-default vhost. I will check what can we do to fix this.

cweagans’s picture

Can we just do something like this in the vhost template?

foreach ($ip_addresses as $ip_address) {
  print "listen {$ip_address}:80;";
}

(I realize that all of the IP addresses aren't provided to the tpl, but should we make that happen?)

omega8cc’s picture

Status: Active » Fixed

Fix tested and committed both to 6.x-1.x and 6.x-2.x

Thanks!

cweagans’s picture

Heh, I didn't think that'd actually work. I wasn't sure if $ip_addresses is actually supplied to the template. Does it work for you?

omega8cc’s picture

Yes, it works. We already had this in the catch-all vhost for HTTPS, so the fix for plain HTTP was simple.

omega8cc’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 02a2f9e on dev-drupal-8, dev-nginx-6.x-1.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by omega8cc:
    Issue #1442906 by cweagans - Nginx should listen on all supplied IP...
  • Commit 6c22dc1 on dev-nginx-6.x-2.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by omega8cc:
    Issue #1442906 by cweagans - Nginx should listen on all supplied IP...
  • Commit 9b1fe19 on dev-nginx-6.x-2.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by omega8cc:
    Issue #1442906 by cweagans - Nginx should listen on all supplied IP...
  • Commit 48c1750 on dev-drupal-8, dev-nginx-6.x-1.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by omega8cc:
    Issue #1442906 by cweagans - Nginx should listen on all supplied IP...