global force_ssl not working

jigster

Verified User
Joined
Jul 23, 2021
Messages
84
As per the instructions at https://www.directadmin.com/features.php?id=2377 I have set the global force_ssl to 1 (cd /usr/local/directadmin; ./directadmin set force_ssl 1). I have confirmed that force_ssl=1 in /usr/local/directadmin/conf/directadmin.conf

If I log into DA as the user, Domain Setup > domain.com > 'Force SSL with https redirect' is ON. But SSL Certificates > 'Force SSL with https redirect' is OFF. The redirect in a browser doesn't work for either domain.com or www.domain.com.

If I untick and re-tick 'Force SSL with https redirect', the redirect works correctly.

It seems that if /usr/local/directadmin/data/users/username/domains/domain.com.conf has force_ssl=1 set, the redirect works. If it is not, even if the global directadmin.conf option is force_ssl=1, the redirect doesn't work! Is this a bug or am I missing something?
 
Did you cycle Directadmin after the change?

Every time you make a change to the directadmin.conf

you need to
Code:
service directadmin restart
 
Thanks, yes sorry i should have mentioned I did that every time I made a change to directadmin.conf. I also tried restarting apache which also didn't help. Is the issue I described the same for everyone, or just on my DA set up?
 
Are you speaking of existing accounts.
OR
New accounts after you made the settings change?
 
This is for existing accounts. It works correctly for new accounts, setting force_ssl=1 in the domain config at /usr/local/directadmin/data/users/username/domains/domain.com.conf when the account is created.

However, the help article says

Any absence of the force_ssl setting in the domain.com.conf will force it to be enabled

So I expected if the global default was set to force_ssl=1 but force_ssl wasn't set in the domain's config (i.e. existing accounts), force_ssl should be on and the redirect to https would work. I wouldn't expect one of the 'Force SSL with https redirect' boxes to be ticked and one not ticked, and for the redirect to not work. Is this the same for everyone, not just specific to my setup? Is this a bug or is there a logical reason for this behavior?

Anyway, I guess it's not a big deal, I can easily update all existing domains' configs with no force_ssl setting to add force_ssl=1. Just wasn't what I was expecting from the help article!
 
Back
Top