I have HTTP to HTTPS redirect configured in server, to display json data coming from arduino MCU on port 8090 I need to restrict http to https redirect, so following this I have configured my apache web server to below
<VirtualHost *:80>
RewriteEngine on
ServerName 192.168.1.45
# force ssl
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
# force HTTP for /arduino
RewriteCond %{HTTPS} =on
RewriteRule ^(arduino) http://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</VirtualHost>
then I restarted apache server and refreshed the page but I am still getting the error in browser console saying:
[Warning] [blocked] The page at https://www.example.com/arduino/gauge.htm was not allowed to display insecure content from http://www.example.com:8090/json. (jquery.min.js, line 5)
I have even tried :
<VirtualHost *:80>
RewriteEngine on
ServerName 192.168.1.45
# force ssl
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
# force HTTP for /json
RewriteCond %(SERVER_PORT} ^8090
RewriteCond %{HTTPS} =on
RewriteRule ^(json) http://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</VirtualHost>
but it doesnt work. same error in console, any help will be greatly appreciated.