Website still sends HTTP request while configured to have all requests coverted to HTTPS in Apache script file

23 Views Asked by At

So we are setting up a website that involves displaying maps. We're generating customized mbtiles files using base mbtiles files from openmaptiles, and serving them with tileserver-Gl on our server.

All tiles are generated and served properly but when our main site tries to retrieve tiles ("pbf"), it sends requests using HTTP instead of HTTP. So the browser raises "mixed-content" error and blocks all of our tiles (no content shows when visiting the map).

We get the following error from the console

Mixed Content: The page at 'blob:https://$DOMAIN' was loaded over HTTPS, but requested an insecure resource 'http://$TILE_SERVER_DOMAIN/14/4594/7133.pbf'. This request has been blocked; the content must be served over HTTPS.

However, we've configured our Apache file to send all requests to our tileserver via HTTPS. Our Apache file:

# ProxyPreserveHost On
# ProxyPass / http://localhost:3010/
# ProxyPassReverse / http://localhost:3010/

RewriteEngine on
RewriteCond %{SERVER_NAME} =$TILE_SERVER_DOMAIN
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

So why is our website still making HTTPS url requests for tileserver? Am I overlooking anything? Any insight is truly appreciated!!

We tried replacing the HTTP reference with HTTPS in our styles file used for tile serving, and re-served the tiles on our tile server. We still got the same error where our site is still requesting tiles via HTTP.

0

There are 0 best solutions below