Issues with HTTPS Redirection in Dspace 7.6.1, Tomcat 9, and Nginx on Windows 10

259 views Asked by At

Hello Stack Overflow community,

I'm currently facing challenges while setting up HTTPS access for my Dspace 7.6.1 instance, using Tomcat 9 and Nginx as a reverse proxy on a Windows 10 server. This marks my initial Dspace installation, and everything proceeded smoothly. I can access the platform locally through "localhost:4000". However, upon configuring Nginx and attempting external access, a redirection occurs, leading to a 500 error page after 2 seconds.

Nginx Configuration:

server {
    listen 80;
    server_name fevasf-repositorio.ddns.net;
    rewrite ^ https://fevasf-repositorio.ddns.net permanent;

    location / {
        proxy_pass http://localhost:4000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

server {
    listen 443 ssl;
    server_name fevasf-repositorio.ddns.net;

    ssl_certificate C:/nginx-1.25.3/cert/cert.pem;
    ssl_certificate_key C:/nginx-1.25.3/cert/privkey.pem;

    location / {
        proxy_pass http://localhost:4000;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /server {
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-Host $host;
        proxy_pass http://localhost:8080/server;
    }
}

"config.prod.yml" Configuration:

ui:
  ssl: false
  host: localhost
  port: 4000
  nameSpace: /
  rateLimiter:
    windowMs: 60000
    max: 500
  useProxies: true

rest:
  ssl: false
  host: localhost
  port: 8080
  nameSpace: /server

"local.cfg" Configuration:


space.server.url = http://localhost:8080/server
dspace.ui.url = http://localhost:4000

"server.xml" Configuration for Tomcat:

<Connector port="8080"
           minSpareThreads="25"
           enableLookups="false"
           redirectPort="8443"
           connectionTimeout="20000"
           disableUploadTimeout="true"
           URIEncoding="UTF-8" />

Nginx Log Error:

2023/12/08 13:30:18 [error] 5856#5432: *394 connect() failed (10061: Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente) while connecting to upstream, client: 192.241.215.42, server: fevasf-repositorio.ddns.net, request: "GET /autodiscover/autodiscover.json?@zdi/Powershell HTTP/1.1", upstream: "http://127.0.0.1:4000/autodiscover/autodiscover.json?@zdi/Powershell", host: "189.41.79.255"

I've experimented with various configurations, but none have proven successful. Could someone from the community assist me in troubleshooting? I've been grappling with this for a week now. Thank you in advance,

0

There are 0 answers