-
Notifications
You must be signed in to change notification settings - Fork 71
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
Karaf seems to send derivative requests to the wrong place. #1070
Comments
That is odd because the response URL (ie http://staging.example.nz/node/5/media/image/18) is provided by your Drupal instance here. So does your Drupal instance respond to non-SSL requests? |
Thanks for the quick (and extremely useful) response! We made some changes yesterday with regard to Drupal 8 and Reverse Proxying, namely Is there any way to override this setting? It seems redundant to go Karaf -> Proxy -> Drupal when it could go Karaf -> Drupal. |
Except that I think we are doing that (Karaf -> Drupal), but Drupal is telling us to go to the Proxy. Which indicates that Drupal is setting the post back address as non-SSL Drupal address when we generate the event for Alpaca, but then when we try to post to that URL Drupal says "Oops you want the Proxy (302)`. This could be a Drupal 8 problem or perhaps we need to look at the use of Url::fromRoute() and reverse proxies. This might require more investigating. |
When you work against Drupal 8 are you accessing the SSL or non-SSL site? |
I am accessing Drupal via an SSL site. So, to try and clarify the exact steps (I think) are happening here:
I am more than likely missing some parts here, but this is my understanding of it, it's the 'goes through the reverse proxy' part of Step 7 that feels redundant to me. |
@alistairjmcintyre |
@alistairjmcintyre What I think what is happening is:
So what we probably need to do is handle the 302 better and have Alpaca just try again at the redirected URL. |
I'm with you up until about Step 7, except derivatives are definitely being generated and Karaf logs ( /opt/karaf/data/logs/camel.log ) are not showing any errors. Drupal knows it's behind a Reverse Proxy ( https://medium.com/@lmakarov/drupal-8-and-reverse-proxies-the-base-url-drama-c5553cbc9a3e proved to be an invaluable resource for this ) and as such the base url of the website it knows to be 'https://staging.example.nz', which I guess is the one that Karaf is using. It seems like it would be more efficient to go directly back to Drupal, without having to jump through the proxy. |
Sorry but in your initial ticket you said that you were getting an error
when generating derivatives.
Is this not the case?
…On Thu, Mar 28, 2019, 18:13 Alistair McIntyre, ***@***.***> wrote:
I'm with you up until about Step 7, except derivatives are definitely
being generated and Karaf logs ( /opt/karaf/data/logs/camel.log ) are not
showing any errors.
Drupal knows it's behind a Reverse Proxy (
***@***.***/drupal-8-and-reverse-proxies-the-base-url-drama-c5553cbc9a3e
proved to be an invaluable resource for this ) and as such the base url of
the website it knows to be 'https://staging.example.nz', which I guess is
the one that Karaf is using.
It seems like it would be more efficient to go directly back to Drupal,
without having to jump through the proxy.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1070 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACua4WCsyN8KERO3tWl3ZZ4GPB01YEHJks5vbUyBgaJpZM4cO5iK>
.
|
My apologies for the confusion. Initially (when I made this ticket) I had an awful, evil nginx config that only allowed HTTP traffic via the webserver to the proxy, without that, I would get the error about a 302 redirect in Karaf. We've since learned a few things about Reverse Proxying and Drupal 8 that we didn't know, tweaked relevant settings both in nginx and Drupal and the 302s aren't an issue at all now (although something to be aware of for anyone who's going to put Islandora behind a reverse proxy). The real problem here is Karaf is routing traffic to the wrong place. It shouldn't be routing traffic from Karaf, to the Proxy, then onto Drupal, when Karaf and Drupal are on same machine, but the Proxy is on another. Currently it's functional, but I don't think it's expected behavior that it would require 2 network hops rather than talking to another service on the same machine. |
Alpaca is pretty naive when it comes to this. It really doesn't know anything at all about the urls it uses. It's straight up told where to fetch and put everything with info in the message it reads from the queue. We generate that message using a Drupal action, so in theory it's totally possible to monkey with that PUT url to get things right. We'd just have to figure out how best to do it without interfering with non-TLS-terminating setups. Either some hardcoded special case logic or maybe let modules alter the message before it goes to the queue? BTW thanks for linking that article @alistairjmcintyre, it was super informative. Learn something new every day... |
This seems like a feature which (if the services are on the same machine) would allow you to replace the hostname of the machine with |
We currently have Islandora 8 running behind an nginx reverse proxy server that takes care of TLS termination.
We enforce HTTPS everywhere which results in 301 or 302 redirects to the https entry, but I'm getting the error below when generating a derivative:
I'm wondering a couple of things regarding this:
I'm not particularly adept with Karaf and/or Camel, so it's plausible there's something I'm missing here.
I do have a work-around for this at the moment, but it involves some truly truly evil nginx config and an /etc/hosts entry and that seems like I'm doing it the wrong way.
The text was updated successfully, but these errors were encountered: