-
Notifications
You must be signed in to change notification settings - Fork 326
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 a new backend API and accessing it returns 404 via nginx #168
Comments
@GUI any pointers for the above issue? We are using api-umbrella v0.8.0 |
@ashakunt: Hm, I just ran through the setup directions on a fresh installation of v0.8.0 under Ubuntu 14.04, and it seemed to work for me. But sorry you've run into troubles. And you're sure you went to the Publish page after saving the API Backend and published your changes? If the backend wasn't published, that would explain a 404 response, but if the backend is in fact published, then this is a little more puzzling. If the backend is published, here's a couple things to try:
We did change a fair bit of the logic behind how hostnames get matched for routing purposes in v0.8.0, so I'm wondering if you're maybe hitting something related to that. I think we also fixed a few things revolving around hostname matching after the v0.8.0 release in master, but I didn't think those fixes were particularly critical. But hopefully we can get to the bottom of this without too much trouble. |
Thanks a lot @GUI for pointers. Some of my answers below:
I will provide updates and contents of backends.conf as soon as I can. |
What is the status of this issue? |
Here are the details
|
@GUI turns out, restarting did not help.
Can you please suggest with priority what should be done in order to fix this issue and get the umbrella up and running asap |
|
@GUI for your information, i just added:
to /opt/api-umbrella/embedded/etc/nginx/nginx.con and it does not seem to have any effect. |
@GUI, sorry for spamming too much, but eventually, editing the router.conf / web.conf at /opt/api-umbrella/etc/nginx is not of any help either since they are overwritten upon every start! |
So, aparently, I had to make changes in:
With this change, the server is up and running again. I will check next the api requests! |
And this also helps in removing the 404 status for accessing the API. Although, I must say that the instructions at http://apiumbrella.io/images/docs/add_api_backend_example-af3ba028.png must be updated to have the frontend host have the value of: I am now waiting for you to review this bug (sever_names_hash_bucket_size 64;) and in case its already fixed in upstream, please close this bug. |
@ashakunt: Ah, thanks for sleuthing this, these details really helps. If you have a chance and could do one more thing, could you report the results of So basically, I think triggering this issue is dependent on the length of the hostnames you're using and also what type of CPU your server is on (since that will dictate the default The workaround you've implemented by adding values to the But for the next package release, I think we can aim to eliminate this specific issue altogether. Since we know the length of the hostnames we're adding in the templates, it should be pretty easy for us to detect if the hostnames are longer and adjust the More generally, we may also want to add the ability to customize these kind of nginx settings without having to modify the templates. We typically do that by exposing specific setting in our YAML config file, but it's also been on my radar to maybe come up with a more generic solution for any type of nginx config customizations without us having to explicitly support specific settings (maybe allow including other external nginx config file at various places). |
@GUI here you go:
Please don't be sorry about the overwriting confusion. I am sure you have your own reasons to re-write them. :) |
It was possible that nginx would bomb if an API backend was added with a long hostname. The exact length that would trigger this error varied, since nginx's default lengths actually varied depending on the CPU type. But this should fix things so that we should properly support hostnames up to 110 characters long regardless of CPU defaults. Fixes NREL/api-umbrella#168
Fixed in master by NREL/api-umbrella-router#9 This will be part of the v0.9 release. We now adjust this nginx setting based on the length of the longest hostname in the system. This should fix things so that the default nginx value (based on the CPU architecture) shouldn't matter. Thanks for the report! |
@GUI I am having the same issue as @ashakunt. I did the changes suggested but I still get 404. Here is my output from Any ideas? |
By the way my path to those files is |
@mauriciovieira is this issue related to the difficulties you encountered with API Umbrella installation? |
We are still encountering this issue after upgrading a server from 0.8 to 0.10. |
I added a new API backend at our api umbrella server (umbrella.apinf.io) using the guidelines from: http://apiumbrella.io/docs/getting-started/
After publishing the changes and trying to access the google maps api returns a 404. Any pointers to troubleshoot this problem are highly appreciated.
The text was updated successfully, but these errors were encountered: