tangle_indexer


git clone https://radroots.dev/git/tangle_indexer.git
Log | Files | Refs | Submodules | LICENSE

indexer-nginx.conf (2019B)


      1 server {
      2     listen 80;
      3     server_name _;
      4 
      5     root /usr/share/nginx/html/static;
      6 
      7     location ^~ /indexer_db/ {
      8         deny all;
      9         return 404;
     10     }
     11 
     12     location ~ ^/events/\d+/country/[^/]+/shards/.*\.json$ {
     13         # CORS
     14         add_header Access-Control-Allow-Origin "*" always;
     15         add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
     16         add_header Access-Control-Allow-Headers "Origin, Content-Type, Accept" always;
     17 
     18         if ($request_method = OPTIONS) {
     19             add_header Access-Control-Max-Age 1728000 always;
     20             return 204;
     21         }
     22 
     23         expires -1;
     24         add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate" always;
     25         etag off;
     26 
     27         try_files $uri =404;
     28     }
     29 
     30     location ~ ^/events/\d+/country/[^/]+/manifest\.json$ {
     31         add_header Access-Control-Allow-Origin "*" always;
     32         add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
     33         add_header Access-Control-Allow-Headers "Origin, Content-Type, Accept" always;
     34 
     35         if ($request_method = OPTIONS) {
     36             add_header Access-Control-Max-Age 1728000 always;
     37             return 204;
     38         }
     39 
     40         expires -1;
     41         add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate" always;
     42         etag off;
     43 
     44         try_files $uri =404;
     45     }
     46 
     47     location / {
     48         index index.html;
     49         autoindex on;
     50         autoindex_exact_size off;
     51         autoindex_localtime on;
     52 
     53         add_header Access-Control-Allow-Origin "*" always;
     54         add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
     55         add_header Access-Control-Allow-Headers "Origin, Content-Type, Accept" always;
     56 
     57         if ($request_method = OPTIONS) {
     58             add_header Access-Control-Max-Age 1728000 always;
     59             return 204;
     60         }
     61 
     62         expires -1;
     63         add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate" always;
     64         etag off;
     65 
     66         try_files $uri $uri/ =404;
     67     }
     68 }