Redirect Issue with Direct PDF Links in DSpace 8

126 views
Skip to first unread message

sanjib modak

unread,
Aug 10, 2024, 11:38:06 AM8/10/24
to DSpace Technical Support
Description:
We are experiencing an issue in Dspace version 8 with direct PDF links  that was indexed in different search engines when we used the DSpace version 6. When a user clicks on a direct PDF link provided by a search engine (e.g., Google), they are redirected to a localhost:4000 URL instead of the domain name.
we are using Nginx as reverse proxy server and the configuration suggested by the documentation.
Expected Behavior:
The direct PDF link should allow users to access the file and redirect them to the actual domain rather than the localhost.
Actual Behavior:
Configuration:
  • DSpace version: 8
  • Nginx as proxy pass
this is the nginx configuration. 
# Setup HTTPS access
server {
  listen 80;
  server_name domain.com;
 
 
  location /server {
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Forwarded-Host $host;
    proxy_pass http://localhost:8080/server;
  }
 
  location / {
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Forwarded-Host $host;
    proxy_pass http://localhost:4000/;
  }
}
My ssl is being handle by the domain. Will any Nginx configuration changes will resolve this problem? If anyone has any idea how to resolve this issue please suggest.

Karol

unread,
May 21, 2025, 1:32:54 AM5/21/25
to DSpace Technical Support
Hi,
I'm using DSpace version 7.6.3 and I'm having an issue where the frontend redirects old-style bitstream links (e.g., /bitstream/...) to https://localhost:4000/.... Did you  solve this problem?
Best,

Karol

DSpace Technical Support

unread,
May 29, 2025, 5:58:11 PM5/29/25
to DSpace Technical Support
Hi Karol,

If DSpace is redirecting to localhost, but everything else is working fine, then it's possible you need to set the X-Forwarded-Host and/or X-Forwarded-Proto headers in your Apache or Nginx proxy.  It sounds like the DSpace backend isn't getting the information it needs through your proxy.  This issue is essentially similar to the one listed in our "Common Installation Issues" about how the robots.txt has incorrect sitemap URLs: 
https://wiki.lyrasis.org/display/DSDOC8x/Installing+DSpace#InstallingDSpace-MyUserInterface'srobots.txthasincorrectsitemapURLs   So, if you follow the instructions there, I suspect it may also fix your issue.

Tim
Reply all
Reply to author
Forward
0 new messages