File Storage Web3 Server

SKALE Chain nodes run a special NGINX Webserver that provides read-only access to each file uploaded using SKALE Chain Filestorage.

To access the file, use the following URL convention:

http(s):/NODE_DOMAIN_NAME/SKALE_CHAIN_NAME/FILESTORAGE_FULL_PATH

Example:

https://node1.validator.com/fluffy-marsupial/77333Da3492C4BBB9CCF3EA5BB63D6202F86CDA8/directoryA/random_text.txt

The NGINX config is as follows:

limit_req_zone $binary_remote_addr zone=one:10m rate=7r/s;

server {
    listen 3009;

    {% if ssl %}
    listen 311 ssl;
    ssl_certificate     /ssl/ssl_cert;
    ssl_certificate_key /ssl/ssl_key;
    {% endif %}

    proxy_read_timeout 500;
    proxy_connect_timeout 500;
    proxy_send_timeout 500;

    error_log /var/log/nginx/error.log warn;
    client_max_body_size 20m;

    server_name localhost;
    limit_req zone=one burst=10;

    location / {
        include uwsgi_params;
        uwsgi_pass 127.0.0.1:3010;
    }
}

server {
    listen 80;

    {% if ssl %}
    listen 443 ssl;
    ssl_certificate     /ssl/ssl_cert;
    ssl_certificate_key /ssl/ssl_key;
    {% endif %}

    error_log /var/log/nginx/error.log warn;
    client_max_body_size 20m;
    server_name localhost;
    limit_req zone=one burst=50;

    location / {
        root /filestorage;
    }
}