How to Disable https bad request warning

v7
proxy

(Bimoputra Pratama) #1

How do I turn off all https services on Nethserver, public ip on my proxy says the https service on my computer must be turned off because there is a problem directing ip to the computer?


(Markus Neuberger) #2

You may type https://public_ip:980 instead of public_ip:980 in the address bar or if you are internal just click the link https://192.168.1.10:980. Usually you should be redirected automatically. There’s no need to turn off https services.


(Bimoputra Pratama) #3

How do you turn off the warning?


(Markus Neuberger) #4

I have to check, a workaround is to browse to public_ip/server-manager.


(Bimoputra Pratama) #5

Thanks


(Markus Neuberger) #6

Yes, exactly, I didn’t want to write your public IP because it may be misused.


(Markus Neuberger) #7

The httpd-admin port 980 just serves HTTPS so it’s not possible to use it without https://. Unfortunately I didn’t find a possibilty to disable the warning.


(Rob Bosch) #8

Maybe you can create a redirect on http:/server:980 to load https://server:980 instead


(Markus Neuberger) #9

I am afraid redirect is not possible on the same port that just serves https. You may redirect from an http to an https port like from 80 to 443.


(Rob Bosch) #10

And rewrite the url automatically? Maybe by using .htaccess?
https://www.sslshopper.com/apache-redirect-http-to-https.html


(Markus Neuberger) #11

The problem is that you only have https protocol on port 980. So you can’t redirect http://*:980 because there’s only https. Usually you redirect from HTTP(80) to HTTPS(443) - you need different ports.

Hmm, I am going to try… :thinking:

EDIT:

thanks @robb, you’re right:

Basically after the default warning the redirect just works after 3 seconds (tested with edge and opera as firefox and chrome seem to use HTTPS by default).

If one doesn’t want to see the warning, a redirect also works on same port as @robb suggested :

Just add /etc/httpd/admin-conf.d/rewrite.conf with following content and do systemctl restart httpd-admin:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_ADDR}:980  [R,L]
#RewriteRule (.*) https://%{SERVER_NAME}:980 [R,L]

You may use the SERVER_NAME line (4) instead of the SERVER_ADDR one (3) to redirect to https://systemname.domainname:980 instead of https://green_ip:980


(Rob Bosch) #12

Thnx for your effort and testing this @mrmarkuz. Highly apprecated!