When redirection is enabled on a site, the generated nginx vhost config has syntax errors preventing nginx from restarting.

Testing nginx configuration: nginx: [emerg] "listen" directive is not allowed here in /var/aegir/config/server_master/nginx/vhost.d/sitename.com:57
nginx: configuration file /etc/nginx/nginx.conf test failed

The failing lines of config:

# alias redirection virtual hostserver {
  limit_conn   gulag 32;
  listen       *:80;
  server_name  somealias.something.com;
  access_log   off;
  rewrite ^ $scheme://www.sitename.com$request_uri? permanent;
}
CommentFileSizeAuthor
#1 2117227-nginx-missing-newline.patch642 bytesOgredude
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ogredude’s picture

Attached is a patch that adds the newline in the proper place.

omega8cc’s picture

Status: Needs review » Fixed

Thanks for the report and for the patch! Committed in http://drupalcode.org/project/provision.git/commit/3226473

omega8cc’s picture

Issue summary: View changes

edit description to include detail

Status: Fixed » Closed (fixed)

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

  • Commit 3226473 on 6.x-2.x, 7.x-3.x, 6.x-2.x-backports, dev-helmo-3.x by omega8cc:
    Issue #2117227 by Ogredude - Missing newline causes syntax errors in...