Hi Paul,

Could you provide more info on the CORS errors?

The reason I ask, is that I wonder what URL the backend thinks you are sending 
requests from.  CORS errors should only occur if the URL sending requests (to 
the REST API) is *not* listed in the "rest.cors.allowed-origins" setting.  So, 
that makes me suspect that the UI is sending requests under a URL that is *not* 
identical to what you set for "dspace.ui.url" in the backend.

Generally speaking, the frontend configuration and backend configuration need 
to be identical, or you will hit problems.

So, this means, in the Angular UI, the "ui" environment settings:
https://github.com/DSpace/dspace-angular/blob/main/src/environments/environment.common.ts#L10-L16
need to *match* what you configure as "dspace.ui.url" on the backend.

Similar, in the Angular UI, the "rest" environment settings:
https://github.com/DSpace/dspace-angular/blob/main/src/environments/environment.common.ts#L20-L26
need to *match* what you configure as "dspace.server.url" on the backend.

If the "ui" settings don't match, you are likely to end up with CORS errors, as 
the UI will be sending requests from a slightly different URL and the REST API 
will block those requests.  This is my _best guess_ at what you might be seeing.

Tim


________________________________
From: [email protected] <[email protected]> on behalf of 
Paul Warner <[email protected]>
Sent: Tuesday, August 4, 2020 12:32 AM
To: DSpace Technical Support <[email protected]>
Subject: [dspace-tech] dspace7 installation on remote server with apache

Hi,

My team wants very much to test dspace 7, and I have an installation on a 
remote server that uses apache as the frontend proxy.  I did this so I can 
offer the site to my team with ssl/tls.  They cannot get to the command line on 
the server, and a command line browser (w3m) does not work with angular anyway. 
 So they need a url that is external.

I have set the rest.cors settings in local.cfg:

rest.cors.allowed-origins = ${dspace.ui.url}

and have set the dspace.ui.url to the url to apache.  I am still getting cors 
errors in the browser (Firefox).  There are no errors anywhere else in the logs.

Is there a better way to set up dspace 7 so it is visible from a domain 
externally?

Best regards,
Paul

--
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 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/ee9bb9f8-117d-4113-a0d3-548861121d45o%40googlegroups.com<https://groups.google.com/d/msgid/dspace-tech/ee9bb9f8-117d-4113-a0d3-548861121d45o%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/DM5PR2201MB11489453B72EC2E040B3327EED4A0%40DM5PR2201MB1148.namprd22.prod.outlook.com.

Reply via email to