Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an override with a server block causes duplicate warnings to be thrown #15

Open
abea opened this issue Sep 7, 2018 · 1 comment

Comments

@abea
Copy link
Contributor

abea commented Sep 7, 2018

In top I have this on the otherplace mechanic overrides directory:

server {
  listen *:80;
  # Redirect old blog traffic to new blog section.
  server_name www.place.com place.com;

  location / {
    rewrite ^(.*)$ http://otherplace.com/first-place$1;
  }
}

Since otherplace has --https=true set, it outputs top above both the 80 and 443 server blocks. This throws the warning:

nginx: [warn] conflicting server name "place.com" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "place.com" on 0.0.0.0:80, ignored

There should be a way to have the override only printed once or use a port variable in the override (though that'd cause difficulty by requiring a cert on the redirected URL).

@boutell
Copy link
Member

boutell commented Sep 7, 2018

Agreed, I can't think of a situation where "top" being included twice is useful given that it's not inside any kind of block.

For this particular project, since what was wanted from "top" was essentially a completely separate (if trivial) site, we moved it to /etc/nginx/conf.d. But mechanic should still handle this right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants