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

FIX https - nginx reverse proxy to http - MIXED CONTENT #672

Closed
dschense opened this issue May 11, 2016 · 2 comments
Closed

FIX https - nginx reverse proxy to http - MIXED CONTENT #672

dschense opened this issue May 11, 2016 · 2 comments

Comments

@dschense
Copy link

dschense commented May 11, 2016

Way to fix the mixed contend error when reverse proxy (i did it with nginx) https domain to http content on local service. (Only in the Desktop version. No problem with the mobile version)

The problem was: //www.openstreetmap.org/openlayers/OpenStreetMap.js file.
I unzipped traccar-web.war to edit the traccar.html file.
there the line: //www.openstreetmap.org/openlayers/OpenStreetMap.js is the problem.

I downloaded this file over the browser and safed it local as OpenStreetMap.js
then I edited all http:// to only // like:

"http://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
 "http://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
 "http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"

<a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>

to:

"//a.tile.openstreetmap.org/${z}/${x}/${y}.png",
 "//b.tile.openstreetmap.org/${z}/${x}/${y}.png",
 "//c.tile.openstreetmap.org/${z}/${x}/${y}.png"

<a href='//www.openstreetmap.org/copyright'>OpenStreetMap</a>

I changed all of them.

after this i uploaded this to github and linked it to rawgit to get accessable file.
Its also possible to upload it to the own webspace to access. (http://rawgit.com/)

after this edit the line above in traccar-web.war --> traccar.html file.
edit:

//www.openstreetmap.org/openlayers/OpenStreetMap.js

to the uploaded and changed

//webserver/address/path/to/OpenStreetMap.js

safe and restart traccar.

after this there are no mixed content anymore.

These are my changes of OpenStreetMap.js:
https://github.com/dschense/script-stuff/blob/master/server/traccar/openlayers/OpenStreetMap.js

@dschense dschense changed the title Https - nginx reverse proxy to http - mixed content FIX https - nginx reverse proxy to http - MIXED CONTENT May 11, 2016
@dschense
Copy link
Author

dschense commented May 13, 2016

Update:

I found some more links with the http - https problem:

'http://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/img/marker-green.png'
'http://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/img/marker.png'

its the same procedure to get https i think

already checked the https link support

'https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/img/marker-green.png'
'https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/img/marker.png'

exist, so

'//cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/img/marker-green.png'
'//cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/img/marker.png'

should do the job again.

vitalidze added a commit that referenced this issue May 18, 2016
…ependent URLs for the tiles. Also store default marker icons in the project codebase.
@vitalidze
Copy link
Owner

Included, written news, updated latest and demo versions.

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

No branches or pull requests

2 participants