Hi Guys, I have successfully installed and setup a tile server with following guide : https://switch2osm.org/serving-tiles/manually-building-a-tile-server-18-04-lts/ Loaded a data for specific region and everything is working OK. However, when i try to access the data from outside, the tile's are not shown. To be more specific on my firewall i've set up a NAT rule whenever i receive a request on port 10780, my PUBLIC_IP:10780 to forward the request to my tile server on HTTP port. Request is forwarded however on the browser nothing is shown, there're no errors in the apache's log and in the server , everything seems fine with the request its coming to the server, since i can see the public IP of the request in the access log of the apache, only with developer tools i got the following : I am using leaflet file and the content of the file is as below :
If i browse the server within my LAN , http://192.168.155.107/ everything is fine, however from outside the tile's are not shown. Can someone help with this , or had similar situation what i need to do in order to access the tile server from outside. Thanks in advance guys. |
You need to use an address that can be reached from the outside. 192.168.155.107 is a private address which probably can't be reached from the outside of your LAN, certainly not from the Internet.
@Scai i am using my http://${PUBLIC_IP}:{PORT} to access the server. I am achieving this with NAT (network address translation) rule set on the firewall , example i am browsing http://44.44.44.44:10780 , once the request comes to my firewall its forwarded to the local server 192.168.155.107 on port 80 which apache accepts it. This is not an issue, the request goes without issues, afterwards tile's are not shown for some reason.
Still, your index.html refers to 192.168.155.107. Therefore your browser tries to contact 192.168.155.107 as can be seen in the screenshot. Your browser doesn't know that 192.168.155.107 is located behind 44.44.44.44:10780. You either need to replace 192.168.155.107 with your public IP address and port (not really a good solution in this case, since both the index.html and the tiles seem to be located on the same machine) or you need to specify a relative URL to your tiles instead of an absolute one.
@Scai thank you for the hint and the explanation, it did help. Once i changed the leaflet as per your instruction, it worked as a charm.
Additionally, outbound rule needed to be configured on the Linux machine where the tile's are hosted.
Thanks again for the help.