caps_enhancer/server/nginx.conf
2026-03-23 15:36:40 +03:00

40 lines
1.5 KiB
Nginx Configuration File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server {
listen 80;
listen 443 ssl;
server_name YOUR_DOMAIN;
# SSL (рекомендуется — Chrome требует HTTPS для update_url)
# ssl_certificate /etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem;
root /var/www/caps-enhancer;
index index.html;
# Директория с файлами расширения
location /caps-enhancer/ {
# MIME-тип для .crx — обязателен, иначе Chrome откажется качать
types {
application/x-chrome-extension crx;
application/xml xml;
text/plain txt;
}
# Разрешаем скачивание
add_header Content-Disposition 'attachment' always;
# CORS — если сервер и расширение на разных доменах
add_header Access-Control-Allow-Origin '*' always;
# Кэш для update.xml — не кэшировать (чтобы обновления прилетали быстро)
location ~* \.xml$ {
add_header Cache-Control 'no-cache, no-store, must-revalidate' always;
add_header Pragma 'no-cache' always;
expires 0;
}
# .crx можно кэшировать (файл меняется только при новой версии)
location ~* \.crx$ {
add_header Cache-Control 'public, max-age=86400' always;
}
}
}