DSpace 6.4, NGINX, redirect problem after switching language

30 views
Skip to first unread message

Andrii

unread,
Apr 8, 2023, 3:58:18 PM4/8/23
to DSpace Technical Support
Hello everyone, I am looking for any help or suggestions.
I have a DSpace 6.4 with JSPUI and nginx for proxy (ip->domain) and http->https redirect.
When I am clicking on language button happens redirect from https to http to ip address with 8080 port (will change later) and looks like this: http://server_ip:8080/jspui/home.jsp?locale=en but it must look like this: https://domain_name.com/jspui/home.jsp?locale=en
my nginx config looks like this:

server {
server_name www.domain_name.com domain_name.com;
return 301 https://domain_name.com$request_uri;
}

server {
listen 80;
server_name domain_name.com;
#return 301 $scheme://domain_name.com$request_uri;
access_log /var/log/nginx/domain_name.log;
error_log /var/log/nginx/domain_name.log;
root /opt/tomcat/webapps/;
client_max_body_size 100M;

    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/domain_name.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/domain_name.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

# Redirect non-https traffic to https
    if ($scheme != "https") {
        return 301 https://$host$request_uri;
    }

location / {
return 301 /jspui/;
}

location /jspui/ {
index index.jsp;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://ip_address:8080/jspui/;
proxy_redirect http://domain_name.com/jspui/ https://domain_name.com/jspui/;
proxy_buffering off;
proxy_store off;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 120;
}

location /solr/ {
allow 127.0.0.1;
deny all;
}
}

domain_name and ip_address are changed for security
What can I do wrong?
Reply all
Reply to author
Forward
0 new messages