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

Fix default server #79

Closed
wants to merge 1 commit into from

Conversation

thetechnick
Copy link
Contributor

If I create a default server using a ingress config like this:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: default-backend
  namespace: default
spec:
  backend:
    serviceName: default-backend
    servicePort: 80

the configuration is created, but because of a missing default_server option in the servers listen directive it is not actually been used as the default backend.

@pleshakov
Copy link
Contributor

@thetechnick
Thx!

In this case only one default_server can be created, which is enforced by NGINX. This also entails that all the Ingress rules with empty hostnames will be rejected: NGINX will fail to reload, you'll get something like:

nginx: [emerg] a duplicate default server for 0.0.0.0:80 in /etc/nginx/conf.d/default_server.conf:19
nginx: configuration file /etc/nginx/nginx.conf test failed

It also solves this #52

However, since NGINX configuration stays invalid until we remove all Ingress rules with the empty hostnames until there is only one, I think we should not merge it until we have a handling of cases when Ingress rules have the same hostname in the controller.

@thetechnick
Copy link
Contributor Author

Closing because of time constraints

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

Successfully merging this pull request may close these issues.

2 participants