Closed ZizhanHe closed 8 months ago
When I was using apache, I did something like this
<VirtualHost *:443>
ServerName tiles.foo.lan
ServerAdmin admin@tiles.foo.lan
DocumentRoot /var/www/html/
ErrorLog /var/log/apache2/tiles.foo.lan-error_log
CustomLog /var/log/apache2/tiles.foo.lan-access_log combined
SSLCertificateFile /etc/letsencrypt/live/tiles.foo.lan/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/tiles.foo.lan/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLProxyEngine on
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
ProxyPreserveHost on
ProxyPass / http://192.168.0.222:8080/ retry=1 acquire=3000 timeout=600 Keepalive=On
ProxyPassReverse / http://192.168.0.222:8080/
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"
</VirtualHost>
@acalcutt Thank you so much! I've been trying to solve this problem for days and adding the following lines in the Apache config file solved the problem for me!
SSLProxyEngine on
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
...
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"
Glad to hear you got it working :-)
I am building a webpage containing a map with tiles served via TileServer-GL. I served the default " zurich_switzerland.mbtiles" and when I visit tileserver-gl's interface
(http://$server_ip:8080/
) and click on "TileJson" under the DATA section, I see the following{"tiles":["http://$SERVER_IP:8080/data/openmaptiles/{z}/{x}/{y}.pbf"]
My question is: Is there any way to change URL template in "tiles" attribute to use HTTPS instead of HTTP? And why is it using HTTP (is the default HTTP? or is it something to do with config.json file for example)?I want to change this to HTTPS because my browser (chrome) is automatically blocking content loaded over HTTP, so all "pbf" files are blocked and marked as "unsafe". More specifically, when I click on "Viewer" in Klokantech Basic in the tileserver-gl's interface, I see that all "pbf" files are loaded via HTTP using the template format defined under "tiles" (see screen shot below) and I get "mixed-content" error.
I've read the Tileservr-gl doc and the TileJson doc but failed to find any way to modify "tiles" to use HTTPS.
Here's exactly what I did 1) Cloned tileserver-gl's github repo 2) Built the docker image using the Dockerfile
docker build -f Dockerfile .-t $DOCKER_IMAGE_NAME
3) Downloaded the sample config.json, styles, and "zurich_switzerland.mbtiles"wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip
unzip test_data.zip
4) Launched the docker imagedocker run --rm -it -v $(pwd):/data -p 8080:8080 $DOCKER_IMAGE_NAME
I am using Ubuntu 22.04.4 and apache2.