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

Rewrite nginx.conf files based on latest Docker dynamic port mappings on server reboot #88

Closed
wants to merge 2 commits into from

Conversation

eugeneware
Copy link
Contributor

When a server reboots all the dynamic port mappings from Docker get reset leading to 502 bad gateway errors in Nginx, or even worse: the wrong servers displaying for different host names.

This PR addresses the issue in #82

It creates a new upstart service called dokku.conf which is run after docker that will iterate through the dokku apps, find the CONTAINER IDs, find the port mapping, rewrite the nginx.conf files and then reload nginx.

@eugeneware
Copy link
Contributor Author

Most PaaS have some sort of routing layer to map from external ports to internal container ports.

Another alternative to rewriting the nginx.conf ports on reboot would be to use similar logic above, but do the port map dynamically upon reboot - see: http://wiki.nginx.org/HttpMapModule

Upon reboot we could scan the CONTAINER IDs and ports, and then dynamically generate a single mapping file that gets included by nginx to do the port mapping.

Does this sound like a valid alternative?

The team at docker haven't been very responsive to my enquiries about the dynamic port allocations.

@ghost
Copy link

ghost commented Aug 16, 2013

Merged #178

@ghost ghost closed this Aug 16, 2013
@asm89
Copy link
Contributor

asm89 commented Aug 16, 2013

Untill we have a more solid approach with a component that's in the working for flynn, we decided to go with the approach in #178. Can you check it out if it works for you too?

This pull request was closed.
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.

None yet

2 participants