EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #10038


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Help with redirect loops in EPrints 3.3.16


CAUTION: This e-mail originated outside the University of Southampton.

Hi!

 looking at https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FHow_to_use_EPrints_with_HTTPS&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379720176%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=4Sx89sJ8VkRBijPRLfT4fC7HUdHLRc98Mu%2FeMCVHIU8%3D&reserved=0:

$c->{host} = 'YOUR-REPOSITORY-DOMAIN';
$c->{port} = 80;
$c->{aliases} = [];
$c->{securehost} = $c->{host};
$c->{secureport} = 443;
$c->{http_root} = undef;

while yours:


    $c->{host} = 'ru.iiec.unam.mx';
    $c->{port} = '80';
    $c->{aliases} = [];
    $c->{http_url} = 'https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2F&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379736320%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=OPX9yVTJCxgkd0tFLLWoRY983H5ykgz7sqCgxt7ZqMo%3D&reserved=0';
    $c->{http_cgiurl} = 'https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379749952%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=7W0UcqmRXuk6t%2FuYvXeqczpJDJMrBGh5SW8yCsjEoOE%3D&reserved=0';
    $c->{base_url} = "https://$c->{host}";
    $c->{securehost} = $c->{host};
    $c->{secureport} = 443;
    $c->{http_root} = undef;

Try to remove:

    $c->{http_url} = 'https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2F&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379764869%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=J59cKw7RYTwCvGF4Cy5Wm4H5iKs6fCVVc%2BHHM2gJvts%3D&reserved=0';
    $c->{http_cgiurl} = 'https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379779670%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=RUd4mIZphXt20cS4Xc0F8rpGTfU4xmDPp76%2BV7D%2BZA4%3D&reserved=0';
    $c->{base_url} = "https://$c->{host}";

 If you just need redirection to https after login, regenerate the
apacheconf and it should work.

That said, if you want an https-only configuration, if you search the
mailing list topic "empty c->{’host‘} in Eprints 3.3.XX" you will find
many suggestions for having a full https Eprints 3.3.XX.

 Also "Eprints with Nginx Proxy Manager as Load Balancer" has some
interesting stuff.

 You can debug rewrite rules in Apache with:

LogLevel debug rewrite:trace3

 in /usr/share/eprints3/cfg/apache/yoursite.conf

 if nothing appears, it is the EPrints::Apache::Rewrite doing the
redirects and then you need to do the redirect managed as in "empty
c->{'host'} in Eprints 3.3.XX".

Il 13/03/25 01:15, Gunnar Wolf ha scritto:
CAUTION: This e-mail originated outside the University of Southampton.

CAUTION: This e-mail originated outside the University of Southampton.

Hello,

I have long been running an EPrints 3.3 installation. I recently...
broke part
of its functionality, and am losing my little remaining hair to get it
back
working. I have decided to humbly ask for your help.

The issues started a couple of months ago, when we decided to enable
TLS-based
connections, due to browsers (and indexers) no longer trusting HTTP-only
sites. I set up Letsencrypt's Certbot, and was happy. Only that I had
issues
with some routes — sometimes, I'd have dynamic URLs generated to
/cgi/users/home/, but most often only to /users/home (which made it quite
painful to upload new items... but was not 100% unworkable)

Anyway, a couple of days ago, I found and tried to follow what appears
to be the
official instructions:

    https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FHow_to_use_EPrints_with_HTTPS&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379794477%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=%2F3ipwkf9v9EiWr6ziloVn0h1%2Fhz9f8UUB0uzkL9ZvpU%3D&reserved=0

This led me to a more painful reality, where redirect loops just won't
let me
call anything under /cgi/users/home -- that is, most of EPrints' actions!

    $ HEAD -S https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fusers%2Fhome&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379808295%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=DyX0NBuERbgnDUjkJKHRUmmO7Z3dA1WAkqP6y8WYPLs%3D&reserved=0
    HEAD https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fusers%2Fhome&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379821336%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=jQ9e6GGndGkmgAkIrTARC8KcpBZ8o3JfMBLg9heopKY%3D&reserved=0
    302 Found
    HEAD https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fusers%2Fhome&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379832822%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=4UMY94KkWCsWKwK4B3L5UksM%2B0xY4rcjLSl3vhajo9c%3D&reserved=0
    302 Found
    HEAD https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fusers%2Fhome&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379844269%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=QjAfPr%2FHR7E96vY%2B5tv7DnDuDvVrYqSXPcY4rtnh7qo%3D&reserved=0
    302 Found
    HEAD https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fusers%2Fhome&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379856146%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=3hrlKVs9yEzcl3%2F9pRJysJNb4PMVPfu8Kiy9puxVaU4%3D&reserved=0
    302 Found
    HEAD https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fusers%2Fhome&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379868053%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=sz8fshQnQtDS4A6qrndM7910qjAIzOCXaDDS8rF3BMA%3D&reserved=0
    302 Found
    HEAD https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fusers%2Fhome&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379879726%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=iUUztiItZXvViR3V%2FogXlEI%2Fs7ZxIHNmUgFkxIGmOgo%3D&reserved=0
    302 Found
    HEAD https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fusers%2Fhome&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379891433%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=YWARPkr31jAJbKGu4aOCV3TqIEyczBKDhpHTZnOqm10%3D&reserved=0
    302 Found
    HEAD https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fusers%2Fhome&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379905574%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=mz2ZuX0VNKUIpllQ46yiqiJuFyA5gJJIgxcLy21dELY%3D&reserved=0
    302 Found
    Connection: close
    Date: Wed, 12 Mar 2025 23:54:11 GMT
    Location: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fusers%2Fhome&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379917928%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=MDvxD29WTjBI79tl1yp%2Fv9hYyeqmetv3k4uLbSTSUSI%3D&reserved=0
    (... headers describing my certificate ...)
    Client-Warning: Redirect loop detected (max_redirect = 7)

(FWIW, no issues in publicly displaying my repository's URL 😉)

All other requests work fine, including those aiming at others in the
/cgi
namespace:

    $ HEAD -S https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fstats%2Freport&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379929841%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=VOxToltiEYsP81m56vHlZM8zyOe3%2FvjdU%2B0nqSTaMEI%3D&reserved=0
    HEAD https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fstats%2Freport&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379941377%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=lrD2yqbPkk%2FaJiLVdA8ge1K0oiYUK25xfihWNo%2BXRA4%3D&reserved=0
    302 Found
    HEAD https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi%2Fstats%2Freport&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379952869%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=1cHkjbV5FXTfmE6%2B1uN9yw2LdwE0%2FQWiaAGb%2BkpfdFE%3D&reserved=0
    200 OK

I don't want to spam the list with all of my existing bits of
configuration. Please tell me if there is anything worth sharing. The
contents
of my cfg/cfg.d/10_core.pl file are:

    # This file was created by bin/epadmin
    # You can regenerate this file by doing ./bin/epadmin config_core
iiec
    $c->{host} = 'ru.iiec.unam.mx';
    $c->{port} = '80';
    $c->{aliases} = [
    ];
    $c->{http_url} = 'https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2F&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379964609%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=nzlhEsY8BGJ4VrD%2FV9GQ8bE2kARHSG1%2BWEGxNATQRmQ%3D&reserved=0';
    $c->{http_cgiurl} = 'https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379976404%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=hETmHrFpsmSMPvf4g3RqPdtElGxRIuiiChWfYsB7bMw%3D&reserved=0';
    $c->{base_url} = "https://$c->{host}";
    $c->{securehost} = $c->{host};
    $c->{secureport} = 443;
    $c->{http_root} = undef;

Thank you for any advice you can give me!

*** Options: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FEprints-tech_Mailing_List&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379987851%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=Im7l59CwCzwpUdTJBnvvBDFnf5EEPDYO7W1IkOSzW%2Fw%3D&reserved=0
*** Archive: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490379999292%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=2ajJEAiwtwib3CElY8uTldMMGXd6b0l2XzxQRa011Ew%3D&reserved=0
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2F&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C29fdf71cd61a4afbad9b08dd6203bcd6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638774490380011306%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=0zby%2FZrqc5HLqeX1pksXTGZjJhuil4r3HST%2FEdQVxJA%3D&reserved=0

--
Yuri Carrer

 CAB - Centro di Ateneo per le Biblioteche, Università di Padova
 Tel: 049/827 9712 - Via Beato Pellegrino, 28 - Padova