Authentication Issue when Accessing Redmine Apache2 ProxyPass
Added by Bruno Iurko about 1 year ago
I am facing a problem in my Redmine environment running in a Docker container. Below are relevant details about the environment:
Redmine version: 5.0.6.stable
Ruby version: 3.1.4-p223 (2023-03-30) [x86_64-linux]
Rails version: 6.1.7.6
Database adapter: PostgreSQL
Redmine plugins: mega_calendar 1.9.3, redmine_agile 1.6.5, redmine_checklists 3.1.22, redmine_contacts 4.3.7, redmine_issue_dynamic_edit 0.9.1, redmine_people 1.6.3, redmine_wktime 4.7
Problem:
When accessing Redmine through a ProxyPass configured in Apache, the system is requesting multiple authentications. The Redmine log indicates the following error:
I, [2023-12-20T16:42:14.528832 #1] INFO -- : Completed 401 Unauthorized in 34ms (ActiveRecord: 2.4ms | Allocations: 1853)
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName xxxxxxxx
RequestHeader set X_FORWARDED_PROTO 'https'
RewriteCond %{HTTP_COOKIE} redmine_user=([^;]+) [NC]
RewriteRule ^/(.*)$ http://localhost:81/$1 [P]
ProxyPreserveHost On
SSLCertificateFile /etc/letsencrypt/live/tasks.prefigura.social/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/tasks.prefigura.social/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
ErrorLog ${APACHE_LOG_DIR}/redmine_error_log
ProxyPass / http://localhost:81/
ProxyPassReverse / http://localhost:81/
RewriteEngine On
RewriteCond off
RewriteRule ^ https://{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</VirtualHost>
</IfModule>
Additional Context:
The environment is using SSL/TLS with Let's Encrypt certificates.
Redmine is running on port http://localhost:81/ through ProxyPass.
Actions Taken So Far:
Checked authentication settings in Redmine, and they are correct.
Confirmed that Redmine is running correctly on port 81.
Analyzed logs from Redmine and Apache, but did not identify the root cause of the problem.
Screenshot_1.png (12.9 KB) Screenshot_1.png |