UI Configuration

254 views
Skip to first unread message

Kyky

unread,
Jul 3, 2023, 7:24:08 AM7/3/23
to DSpace Technical Support
Hello everyone, i've got problem with my UI config after add SSL.

this is my configuration:
local.cfg

dspace.server.url = http://51.79.225.29:4420/server/
dspace.ui.url = https://dspace.logiaedu.com

config.prod.yml
ui: 
    ssl: false
    host: 51.79.225.29
    port: 4000

rest:
    ssl: false
    host: 51.79.225.29
    port: 4420
    nameSpace: /server

before applying the ssl and configure the backend config it works perfectly, but after applying ssl and change the backend config, it's always redirect to /500 Service Unavailable. i've read some issues like this and tried to fix it like the reference but it's still failed


Thanks

Kyky

DSpace Technical Support

unread,
Jul 5, 2023, 3:20:24 PM7/5/23
to DSpace Technical Support
Hi Kyky,

I suspect the issue may be that the backend is NOT running SSL/HTTPS.  The REST API *MUST* run HTTPS if you are using non-"localhost" URLs.  It's also not possible to run the UI on HTTPS while keeping the REST API on HTTP.


Tim

Katy Earl

unread,
Jul 18, 2023, 8:34:24 PM7/18/23
to DSpace Technical Support
Hello, 

I'm working on similar server 500 errors, and I decided to take a break on working my certs and have my front end connect to https://api7.dspace.org/server instead, as its certs are working.... To do so, my config.prod.yml looks like this now.

ui:
  ssl: false
  host: localhost
  port: 4000
  nameSpace: /
  rateLimiter:
    windowMs: 60000 # 1 minute
    max: 500 # limit each IP to 500 requests per windowMs
  # Trust X-FORWARDED-* headers from proxies (default = true)
  useProxies: true


rest:
  ssl: true
  host: api7.dspace.org
  port: 443
  nameSpace: /server

When I connect to http://localhost:4000/home, I get see api7.dspace.org stuff through my front end and I can navigate it just fine (other than the Log in stuff, of course).

However, as soon as I turn on my virtual host (apache httpd), my front end connects to api7.dspace.org for about 3 seconds, and then it throws a 500. I'm not really sure where to go from here.... Do I need to change config.prod.yml again?

Here is what I have for my virtual host:

<VirtualHost *:80>
ServerName mydomain.com

ProxyPass / http://localhost:4000/
        ProxyPassReverse / http://localhost:4000/
Header set Access-Control-Allow-Origin "*"
</VirtualHost>

What else should I be changing? Restarting pm2 doesn't seem to help... Maybe there is some other Apache setting? ServerRoot? <DocumentRoot>? <Directory>?

Many thanks,

Katy


DSpace Technical Support

unread,
Jul 21, 2023, 3:40:29 PM7/21/23
to DSpace Technical Support
Hi Katy,

The problem may be that the demo site backend (api7.dspace.org) is configured to *only trust* requests that come from http://localhost:4000 or https://demo7.dspace.org (the demo frontend).  So, if you try to run a frontend that uses a different URL, then it will be an untrusted URL and may result in a 500 (or other similar errors).  

Simply put, as soon as you want to run the frontend via a different URL, you will need to use your own backend.  The demo backend is only for basic demo / development purposes. 

I suspect that may be what you are seeing.

Tim

Reply all
Reply to author
Forward
0 new messages