In short: This is about proxy-ing access to OpenMapTiles (OMT) by Apache Http. The proxy works hence the PBF tiles from OMT reach the client. However Leaflet fails to draw the PBF tiles in the map.
Below is the detailed:
I am responsible in providing OMT service in intranet of my organization. An existing & running internal web app (let's say TheApp) that requires login, currently add a new feature showing map with 2 elements: - geoJSON queried from DB - basemap from my OMT
TheApp is PHP running on Apache HTTP on Fedora.
The strategy is changed. The client has no direct access to OMT, and basemap tiles are provided through Apache Http Proxy. The module used in Apache HTTP is mod_proxy. The result is just fine: the map shows geoJSON on top of OMT basemap as expected. Below is the diagram.
The strategy is changed again (but the diagram is similar to Phase-2). This is because in Phase-2, any browser can get the OMT tiles through the Reverse-proxy in the Apache HTTP and we don't like it. Now in Phase-3 we decide that only browser that logged-in in TheApp can get the OMT tiles. My colleague (the admin of the Apache HTTP) finds that this requirement can not be achieved by mod_proxy, and hence uses mod_rewrite as suggested by several references. With mod_rewrite he configured that the required resources from OMT (including the PBF tiles) are rewritten to another address.
Now the result is: the mod_rewrite works, as the client re-requests to the specified address, and therefore the client got the PBF tiles. However Leaflet fails to show the PBF tiles.
I suspect that Leaflet can not show the PBF tiles on map because under mod_rewrite the expected identifier of each PBF tile can not be understood by Leaflet. The Z/X/Y naming is still kept in the rewrite result, though.