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

Hitting an undefined app URL displays the 'wrong' app #15

Closed
rnorth opened this issue Jun 16, 2013 · 6 comments
Closed

Hitting an undefined app URL displays the 'wrong' app #15

rnorth opened this issue Jun 16, 2013 · 6 comments

Comments

@rnorth
Copy link
Contributor

rnorth commented Jun 16, 2013

e.g. if you only have one app deployed at foo.dokku.me and for any reason try to hit bar.dokku.me in a browser, you'll see the foo app. While pretty minor, it might be good to display a No Such App page like heroku does, to avoid confusion.

Looks like nginx is routing to either the first or the last servername it knows of if no matching servernames are found. We could fix this by adding a fallthrough server block to the nginx dokku.conf (e.g. with server_name _)

@Kyso
Copy link

Kyso commented Jun 16, 2013

This is actually quite simple, Dokku includes itself before the /etc/nginx/sites-enabled. Just swap those two wildcard includes at the bottom of /etc/nginx/nginx.conf and you'll be sweet to go for setting your default vhost.

EDIT:
That is, swap both the conf.d line and the sites-enabled include lines,

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

to

include /etc/nginx/sites-enabled/*;
include /etc/nginx/conf.d/*.conf;

@progrium
Copy link
Contributor

So we'll leave this to documentation / configuration?

@Kyso
Copy link

Kyso commented Jun 16, 2013

To be honest? Yes, it's just an oddity in nginx.
On Jun 16, 2013 3:35 PM, "Jeff Lindsay" notifications@github.com wrote:

So we'll leave this to documentation / configuration?


Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-19517615
.

@progrium
Copy link
Contributor

I agree. Less software to write, the better! @rnorth is that satisfactory?

@rnorth
Copy link
Contributor Author

rnorth commented Jun 16, 2013

What about placing dokku.conf in sites-enabled in the first place? Does that strain the metaphor of a 'site' too far? ;)

Otherwise, I'm totally fine with the suggestion of documentation - totally agree with the principle of less code!

@progrium
Copy link
Contributor

Let's close for now and if it keeps nagging or other people complain we'll think about it then. I put it on the wiki for now under Recipes: https://github.com/progrium/dokku/wiki/Recipes

If anybody has proto docs or snippets or anything, feel free to put on the wiki. Eventually they might find their way into more official docs.

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

3 participants