I just ran through this and gzip support within RasterIO (v1.0.21) checks out ok. Seems you've just missed the //vsicurl
.
import rasterio as rio
ds = rio.open('/vsigzip//vsicurl/http://localhost:8000/example.tif.gz')
The http server needs to support range requests, but if it doesn't RasterIO will produce a specific error message.
Interestingly the Apache Commons VFS scheme doesn't seem to work here;
ds = rio.open('gzip+http://localhost:8000/example.tif.gz')
Produces the following. Note missing /
before vsicurl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/anaconda3/envs/rasterio-env/lib/python3.7/site-packages/rasterio/env.py", line 423, in wrapper
return f(*args, **kwds)
File "/home/ubuntu/anaconda3/envs/rasterio-env/lib/python3.7/site-packages/rasterio/__init__.py", line 216, in open
s = DatasetReader(path, driver=driver, **kwargs)
File "rasterio/_base.pyx", line 215, in rasterio._base.DatasetBase.__init__
rasterio.errors.RasterioIOError: '/vsizip/vsicurl/http://localhost:8000/example.tif.gz' does not exist in the file system, and is not recognized as a supported dataset name.