aleph
aleph copied to clipboard
HTTPS redirect issue of /api/2/metadata
Have Aleph docker-compose running behind a nginx proxy.
Setting ALEPH_UI_URL
to a prefix of https
caused Aleph to go into an infinite redirect when accessing /api/2/metadata
callback. (Aleph main page started to load but then API errors flooded the screen)
Hypothesis was a broken HTTPS redirect (since proxy is HTTPS but ui is http://localhost)
Curl returned:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="https://domain.org/api/2/metadata">https://domain.org/api/2/metadata</a>. If not click the link....
Found adding the following to the env file corrected the behavior
ALEPH_FORCE_HTTPS=false
and to make search work (without this it tried to hit http when scrolling down on lazy load)
ALEPH_URL_SCHEME=https
This was a satisfactory workaround for us since https redirect is handled by nginx.
@YurkoWasHere Thanks for taking the time to raise this issue and for being patient whilst we get back to you. It sounds like you've resolved this issue by updating Alephs environment settings. Do you think this is simply a case of updating documentation to highlight how to run Aleph behind a proxy?