dspace 7 angular not connecting with remote rest server

78 views
Skip to first unread message

Paul Warner

unread,
Jul 9, 2020, 8:44:19 AM7/9/20
to DSpace Technical Support
Hello,

I am working on getting DSpace 7 running, and I have installed the Angular frontend on one machine in our network, and the Rest Backend on another.  I can reach the REST machine from the Angular machine using a browser, with host ip address and port (8255).  But Angular is not connecting, generating this error:

statusText: 'Unknown Error',
  message:
   'Http failure response for http://localhost:8255/server/api/core/sites: 0 Unknown Error' }

I have entered the settings for the REST server in angular-dir/src/environment/environment.ts, and I can see them in angular-dir/dist/server.js, with the server address and port, 8255.  Angular is getting the port right, but substituting localhost for my server address.

What do you need to know to help me?  The stack trace is quite long.  I can provide whatever information you may need.

I have tested the Angular install with the DSpace default backend: https://dspace7.4science.cloud/server/
and it works. The settings were entered, again, in src/environment/environement.ts.  Why would it not work with my server?  I do not have a hostname for my internal REST server - I am using its ip address.

Thanks in advance for any tips!

Best regards,
Paul

Paul Warner

unread,
Jul 10, 2020, 12:07:49 AM7/10/20
to DSpace Technical Support
One other thing:  I spoke too soon when I said it worked with the default DSpace backend, https://dspace7.4science.cloud/server/, I get the front page without the images, and none of the links work: they all lead to the error page:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /communities/d9c483ca-89d2-437f-aedc-9da0935fd533.

Reason: DNS lookup failure for: localhost:4000communities

Additionally, a 502 Bad Gateway error was encountered while trying to use an ErrorDocument to handle the request.


I see that this is because I am serving my Angular app via apache with a proxy to localhost:4000.  So the domain name for my app is not listed in environment.ts, only localhost:4000. I am using apache as the front facing server because it is robust, allows me to use port 80, and handles the tls.


How should I configure it so it works?


Thanks again for any help!


Best regards,
Paul

Reply all
Reply to author
Forward
0 new messages