From this release we will start blocking .sql
files and archive files by default in Nginx. We do this to prevent accidental exposure
This is done by placing the following line in the Nginx configuration:
location ~ .(sql|zip|tar|tar.gz|tgz)$ { deny all; }
Any requests to files with the extenstion sql
, zip
, tar
, tar.gz
or tgz
will return with a HTTP 403 response.
How to unblock specific files
If you want to host files with one of these extensions and make them downloadable, you can undo this block by placing the following line in your Nginx configuration (in a file called server.zip
in /data/web/nginx/
):
location = /some_directory/some_file.zip {}
Or if you want to unblock an entire directory, you can place the following Nginx configuration:
location ^~ /some_directory/ {}
Other variants of this Nginx configuration work as long as it’s more specific than the Nginx configuration that blocks these files (which can be found at the top of this article).