HTTP to HTTPS redirect

John Konc

Cadet
Joined
Aug 24, 2015
Messages
2
Using TrueNAS 12.0 stable, I enabled HTTP to HTTPS redirect and now I can't connect to the web interface using http or https. IS there a way to disable that from the command line?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
midclt call system.general.update '{"ui_httpsredirect": false}' to flip the setting back. You may also need to run service middlewared restart and service nginx restart to restart the middleware and the web server.
 

dudu2030

Dabbler
Joined
Mar 7, 2021
Messages
11
Hi Samuel,
is there a similar command to disable HTTP from cli ?
i would like to use HTTPS only if possible
 

georgelza

Patron
Joined
Feb 24, 2021
Messages
417

georgelza

Patron
Joined
Feb 24, 2021
Messages
417

seanm

Guru
Joined
Jun 11, 2018
Messages
570
I'm just a 'normal user' too. You have to create an account on their jira, then you get the vote button.
 

vjardine

Cadet
Joined
May 17, 2016
Messages
2
midclt call system.general.update '{"ui_httpsredirect": false}' to flip the setting back. You may also need to run service middlewared restart and service nginx restart to restart the middleware and the web server.
Samuel, Can you help? I'm on TrueNAS 12.0 U7. I checked the box for http to https redirect thinking it will allow me to access via https but it has locked me out. I cannot ping the IP, nor are my SMB shares working. The webserver and ftp servers, however are still functional. I tried your method above but got several lines and the last line got an error "raise Error(self.name, 'A dict was expected'...

Can anyone help? Have lots of data on the NAS that I cannot access.
 

vjardine

Cadet
Joined
May 17, 2016
Messages
2
What I was trying to say is that I can ping the IP, just cannot log in to manage it.
Regards.

[edited -jg]
 
Last edited by a moderator:

calperin

Cadet
Joined
Jan 5, 2013
Messages
5
As proposed, the below solutions doesn't work. I had to run it as Root with SUDO to have no permissions denied. Still I can see that port redirect is active.
"...midclt call system.general.update '{"ui_httpsredirect": false}' to flip the setting back. You may also need to run service middlewared restart and service nginx restart to restart the middleware and the web server...."

Any better option? I also loose my management to Truenas Now that I have it running.
 

calperin

Cadet
Joined
Jan 5, 2013
Messages
5
Finally this works for me:

sudo curl --basic -u root -k -X PUT "https://<Your TrueNAS IP/api/v2.0/system/general" -H "accept: */*" -H "Content-Type: application/json" -d '{"ui_httpsredirect":false}'

and Reboot the unit
 
Top