Support simple static website hosting server
narumincho opened this issue ยท 1 comments
I want to be able to run a web
directory created with Bluemap CLI by simply uploading it to a server that delivers files, such as Amazon S3 or Cloudflare R2.
https://bluemap.bluecolored.de/wiki/webserver/ExternalWebserversFile.html
# map-tiles are stored compressed, and they have a fallback file that should be returned if the tile does not exist
location /maps/ {
error_page 404 =200 /assets/emptyTile.json;
gzip_static always;
}
If this rewrite specification were no longer required, a simple static website hosting server could provide the map
- If the chunk data is 404 on the client side, interpret
assets/emptyTile.json
- When creating the
web
directory, output empty.json for empty chunks.
I think this can be implemented by either
The problem is not the error_page 404 =200 /assets/emptyTile.json;
line .. you can omit that without having too much trouble. The map will work, you will just have some harmless 404 errors in the browser-console-log.
The real problem is the gzip_static always;
line .. which accepts and serves the pre-compressed files. This line is required!
You can already get around this by disabling the compression in the storage-settings .. e.g. in the configs storages/file.conf
set compression: GZIP
to compression: NONE
before rendering the map.
Then all the files are stored uncompressed. And can be served "statically" without the need of the rewrite.
However, without compression, files will be about 20x !! bigger! So i can not recommend doing that.
There is no feasible way to have the compression and make it work without any web-server configuration.