Options -Indexes

<Files ".easychat-runtime-publisher.json">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Deny from all
    </IfModule>
</Files>

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^internal/v1/lead-search-plans$ index.php?route=lead_planner/generate [QSA,L]

    RewriteCond %{HTTP:Accept-Encoding} zstd
    RewriteCond %{REQUEST_FILENAME}.zst -s
    RewriteRule ^(.+\.(?:css|js|json|svg))$ $1.zst [QSA,L]

    RewriteCond %{HTTP:Accept-Encoding} br
    RewriteCond %{REQUEST_FILENAME}.br -s
    RewriteRule ^(.+\.(?:css|js|json|svg))$ $1.br [QSA,L]

    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{REQUEST_FILENAME}.gz -s
    RewriteRule ^(.+\.(?:css|js|json|svg))$ $1.gz [QSA,L]
</IfModule>

<IfModule mod_headers.c>
    # EasyChat — рабочая панель и API, а не публичная страница сайта.
    # Заголовок действует также для редиректов, ошибок и статических файлов.
    Header always set X-Robots-Tag "noindex, nofollow"

    <FilesMatch "\.(css|js|json|svg)(\.(zst|br|gz))?$">
        Header merge Vary Accept-Encoding
        Header set X-Content-Type-Options nosniff
        Header set Cache-Control "public, max-age=31536000, immutable"
    </FilesMatch>

    <FilesMatch "\.zst$">
        Header set Content-Encoding zstd
    </FilesMatch>

    <FilesMatch "\.br$">
        Header set Content-Encoding br
    </FilesMatch>

    <FilesMatch "\.gz$">
        Header set Content-Encoding gzip
    </FilesMatch>
</IfModule>

<FilesMatch "\.css\.(zst|br|gz)$">
    ForceType text/css
</FilesMatch>

<FilesMatch "\.js\.(zst|br|gz)$">
    ForceType text/javascript
</FilesMatch>

<FilesMatch "\.json\.(zst|br|gz)$">
    ForceType application/json
</FilesMatch>

<FilesMatch "\.svg\.(zst|br|gz)$">
    ForceType image/svg+xml
</FilesMatch>

<IfModule mod_mime.c>
    AddEncoding zstd .zst
    AddEncoding br .br
    AddEncoding gzip .gz
    AddType text/css .css
    AddType text/css .css.zst .css.br .css.gz
    AddType text/javascript .js
    AddType text/javascript .js.zst .js.br .js.gz
    AddType application/json .json
    AddType application/json .json.zst .json.br .json.gz
    AddType image/svg+xml .svg
    AddType image/svg+xml .svg.zst .svg.br .svg.gz
</IfModule>

# EasyTokens transport intentionally uses https://api.easytokens.ru by hostname.
# Do not add EASYCHAT_OFFICIAL_SUPPORT_EDGE_IPS here: the HA DNS controller
# performs health-checked failover and clients must follow its A record.
