Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tileserver-gl with https protocol #1013

Open
akram-mhss opened this issue Oct 13, 2023 · 2 comments
Open

tileserver-gl with https protocol #1013

akram-mhss opened this issue Oct 13, 2023 · 2 comments

Comments

@akram-mhss
Copy link

akram-mhss commented Oct 13, 2023

I've successfully set up Tileserver-GL on my Windows system, and it's working perfectly. However, the generated links are using the HTTP protocol, like this:

http://localhost:8080/styles/basic-preview/#14.61/33.57915/-7.60925

My requirement is to change the protocol from HTTP to HTTPS, like so:

https://localhost:8080/styles/basic-preview/#14.61/33.57915/-7.60925

The reason for this change is that when I replace "localhost" with my IP address and use it in my ASP.NET project, I encounter certain issues.

Here's a snippet of my code:
L.tileLayer('http://192.168.*.***:8080/styles/basic-preview/{z}/{x}/{y}.png', {
maxZoom: 19,
}).addTo(map);

The error I'm encountering is as follows:
"Mixed Content: The page at 'https://localhost:7077/Maps/Leaflet' was loaded over HTTPS, but requested an insecure image 'http://192.168..**:8080/styles/basic-preview/6/31/30.png'. This request has been blocked; the content must be served over HTTPS."

Furthermore, I've encountered another issue where, when I access the following link from my server (RDP), http://localhost:8080/, the Tileserver stops unexpectedly. However, when I attempt the same action from a machine (not a server), it functions properly. I'm in need of guidance on how to make the necessary adjustments to resolve these issues.

@acalcutt
Copy link
Collaborator

acalcutt commented Oct 16, 2023

Typically I have tileserver-gl behind a real https server, like HAProxy, Nginx, or Apache

For the rdp thing I am not really sure. we would probably want to find a way to run tileserver as a service, so it doesn't really on the logged in session. I'm not 100% sure how you do that with node, but i will look.

btw, one of our members has a cool .Net port of tileserver-gl, which works in IIS https://github.com/tdcosta100/TileServerGL.NET

@skompc
Copy link

skompc commented Jan 26, 2024

I second this. @acalcutt mind sharing your nginx config?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants