Progmasoft Git

progmaweb

The site and account service of Progmasoft: a Next.js frontend and an ASP.NET Core API.

Clonegit clone https://git.progmasoft.com/progmaweb

mainroot / ops / schemastore / nginx / schemastore.conf

2.2 KiB · Raw · Log

# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
# SPDX-License-Identifier: AGPL-3.0-or-later

# https://schemastore.progmasoft.com: the JSON Schemas of Progmasoft's file
# formats, such as /json/progmasoft-cpp-index.json. Static files only, copied
# from ops/schemastore/json; see ops/README.md. Installed as
# /etc/nginx/conf.d/schemastore.conf.

server {
    listen 80;
    listen [::]:80;
    server_name schemastore.progmasoft.com;

    location ^~ /.well-known/acme-challenge/ {
        root /var/lib/letsencrypt;
        default_type text/plain;
    }

    location / {
        return 308 https://schemastore.progmasoft.com$request_uri;
    }
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    http2 on;
    server_name schemastore.progmasoft.com;

    ssl_certificate /etc/letsencrypt/live/progmasoft.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/progmasoft.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;

    root /srv/schemastore;
    client_max_body_size 1k;

    add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;

    location = / {
        return 302 https://schemastore.progmasoft.com/json/;
    }

    # Editors in the browser fetch schemas from other origins, so every origin
    # may read them. Nothing here takes cookies or writes anything.
    location ^~ /json/ {
        limit_except GET {
            deny all;
        }
        autoindex on;
        charset utf-8;
        charset_types application/json;
        types {
            application/json json;
        }
        expires 1h;
        add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
        add_header X-Content-Type-Options "nosniff" always;
        add_header Referrer-Policy "strict-origin-when-cross-origin" always;
        add_header Access-Control-Allow-Origin "*" always;
        add_header Content-Security-Policy "default-src 'none'; frame-ancestors 'none'" always;
        try_files $uri $uri/ =404;
    }

    location / {
        return 404;
    }
}