Using DSpace7 and dspace-angular behind Apache proxy

1,853 views
Skip to first unread message

Sten Aus

unread,
Feb 26, 2021, 4:34:07 AM2/26/21
to DSpace Technical Support
Hi all

I guess there's not much manual wandering around about using DSpace and dspace-angular behind Apache proxy, so I'm reaching out if anyone has done so?

If angular.ui.url and dspace.ui.url must match in DSpace and angular configurations and API must be accessible outside localhost how do you configure your tomcat, dspace and angular?

I've tried configuring them to my local network IPs, therefore I can get DSpace API and angular to work, but as Apache proxy forwards requests to http://localhost:8080 it get's mixed content response and it's blocked.

Also, API should be accessible outside internet, as DSpace example (https://api7.dspace.org/server/) and this is using Apache's proxy.
There's an "outdated manual" saying to use AJP connector, but not sure if it's outdated because DSpace6->7 or it's just not complete yet.

So, any information using reverse proxy in front of DSpace API and angular frontend is appreciated!

Tim Donohue

unread,
Feb 26, 2021, 10:44:23 AM2/26/21
to Sten Aus, DSpace Technical Support
Hi Sten,

Just wanted to drop a note to say I appreciate the (early) questions on DSpace 7, as it's helpful to us to know what to document​.

As you rightly noted, a guide for Apache proxying with DSpace 7 just doesn't exist yet​.  The DSpace 7 documentation is being worked on, and this guide will exist​ prior to the release. My goal is to have an early draft in time for the community-wide "Testathon" for 7.0 final.  That Testathon is not yet scheduled but seems likely for sometime in April (assuming dev work stays on course in early March, as we are looking likely to wrap up that 7.0 dev work in March).

I wish I had a better answer for you now, but I admit I don't.   It's possible the Atmire team (who is hosting the frontend demo: https://demo7.dspace.org/ behind a proxy) could give you a few early tips, but I'll also admit I have most of them very busy finishing up 7.0 dev work.  

In the meantime, if you want to play around with this, you are welcome to do so.  I'll do my best to answer specific questions (if I know the immediate answer).  But, I'll also be sure to let this list know once the 7.0 installation docs are in a better state to test/verify -- again, I think that is coming in the nearish future, but it's not there quite yet.  (Currently they are very rough: https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace)

Tim



From: dspac...@googlegroups.com <dspac...@googlegroups.com> on behalf of Sten Aus <sten...@gmail.com>
Sent: Friday, February 26, 2021 3:34 AM
To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: [dspace-tech] Using DSpace7 and dspace-angular behind Apache proxy
 
--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/0c001bf6-ac09-426f-8b46-0d925276acf1n%40googlegroups.com.

Sten Aus

unread,
Feb 26, 2021, 12:30:53 PM2/26/21
to DSpace Technical Support
Is there someone from Atmire team here to possibly see my request or am I alone in the dark? :D

Michael Plate

unread,
Feb 26, 2021, 12:35:52 PM2/26/21
to dspac...@googlegroups.com
Am 26.02.21 um 18:30 schrieb Sten Aus:
> Is there someone from Atmire team here to possibly see my request or am
> I alone in the dark? :D
[…]

well, I got it running partially behind a simple Apache reverse proxy -
means, I had CORS errors in FF.

It however worked with Chrome (google-chrome-stable
--disable-web-security --disable-gpu --user-data-dir=/tmp) and I was
able to login (in prod mode, dev does not work because of websockets).

Michael


Sten Aus

unread,
Mar 16, 2021, 9:14:51 AM3/16/21
to DSpace Technical Support
Hi all
Sorry for late reply.

That's not a good solution for production environment anyway.

My guess is that both DSpace and angular should work in local IP addresses and local ports and only Apache/nginx should be exposed and therefore proxy requests per location/request to corresponding endpoint.

So Apache's conf should look something like this

#DSpace backend
  ProxyPass /server http://127.0.0.1:8080/server
  ProxyPassReverse /server http://127.0.0.1:8080/server

# angular UI
  ProxyPass / http://127.0.0.1:4000/
  ProxyPassReverse / http://127.0.0.1:4000/
(Or you can use your internal network IP addresses as well, you don't have to use 127.0.0.1)

The thing is that this causes mixed response and request is blocked.

Also, when accessing backend via URL, server URL is replaced with 127.0.0.1, but not with actual domain, like it's in the Atmire's demo page.



Mateo Palos

unread,
Apr 9, 2021, 11:19:57 AM4/9/21
to DSpace Technical Support
For what it's worth, I'm curious about this as well. Our library an existing Dspace installation that we're hoping to upgrade to 7 and put behind a reverse proxy after release. The end goal for us is to connect with an ADFS SSO system, but getting the proxy working with the various components is the next step. 

Cheers,

Mateo Palos
Ball State University
Reply all
Reply to author
Forward
0 new messages