Followup from #1975188: nginx default server overrides configured vhosts

The changes committed to the vhosts.tpl.php in commit 2233ee15617cd2443cbd9fb156f77f1317f06fbc implement a listener on *:80 instead of using the defined IP address(es), which is great.

However, it also means that in my current server setup, running Nginx and Aegir locally on OS X, no longer works as *:80 doesn't work for localhost access.

The closest I could find to another having a similar issue to this is in the following thread: http://forum.nginx.org/read.php?2,234282,234290#msg-234290

The solution is quite simple, add an additional listener for 'localhost:80' or '127.0.0.1:80' and everything works smoothly .

http://drupalcode.org/sandbox/deciphered/2005700.git/shortlog/refs/heads...
Patch: http://drupalcode.org/sandbox/deciphered/2005700.git/patch/a54dbe0df2648...

Comments

omega8cc’s picture

So it sounds like something OS X specific then, or even ipv6 specific.

But I'm not sure I follow, because adding this extra directive to just the default vhost has no impact on other vhosts.

Do you suggest that we should add it also in the vhost template? OK, I see that the patch is for the vhost only, while it should be also for the default vhost.

Also, how it works in Apache on OS X? Is this purely Nginx specific? Note that we now match the Apache default.

What are the symptoms you are experiencing?

omega8cc’s picture

Title: Nginx vhosts config prevents access on localhost setups. » Nginx vhosts config prevents access on localhost under OS X
Status: Needs review » Postponed (maintainer needs more info)

Note also that this thread confirms that it doesn't work for them with localhost:80;, only with 127.0.0.1:80;

I would like to hear how/if this works with Apache and current Aegir 2.x setup?

realityloop’s picture

Status: Postponed (maintainer needs more info) » Active

there is already a patch for that: http://drupal.org/node/1975188

omega8cc’s picture

Status: Active » Postponed (maintainer needs more info)

Maxim Dounin explained that it is in fact an userland issue:

The problem is not that nginx binded to ipv6 - it instead binded
to ipv4 only. But the tool you've used to connect to nginx only
used ipv6 (or used ipv6 as first option, and didn't fallback to
other addresses).

omega8cc’s picture

We need to investigate more to find the source of the problem and the fix, not a quick workaround. I need answers to my questions posted in comments above.

realityloop’s picture

Status: Postponed (maintainer needs more info) » Active

We've only found this issue with nginx, we don't use apache so are unable to comment on that.

We're not sure this is the correct route, only that is worked for us.

omega8cc’s picture

Status: Active » Postponed (maintainer needs more info)

So if just adding localhost:80; helps for you on OS X, then it is not related to ipv6.

We need more information on debugging, errors etc, to make sure we are introducing a fix and not a blind workaround for unknown issue.

omega8cc’s picture

Also, which Nginx version are you using?

omega8cc’s picture

To better understand why I'm so far against this specific workaround, please see this known bug: http://trac.nginx.org/nginx/ticket/187

realityloop’s picture

Status: Postponed (maintainer needs more info) » Active

I have nginx 1.2.1, Deciphered is using nginx 1.4.1 and the issue is still present without the patch above.

helmo’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

The 6.x-2.x branch will go EOL along with Drupal this week. So I'm closing
this issue. If it remains a confirmed issue in 7.x-3.x, feel free to re-open,
or better yet, create a new issue referencing this one.