Files

45 lines
1.4 KiB
Nginx Configuration File
Raw Permalink 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;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Каталог и обложки: нужен CORS для WebView Lampa
location = /catalog.json {
add_header Access-Control-Allow-Origin * always;
default_type application/json;
try_files /catalog.json =404;
}
location /covers/ {
add_header Access-Control-Allow-Origin * always;
try_files $uri =404;
}
# Торренты torrserver забирает сам (CORS не нужен), но отдадим тоже
location /torrents/ {
add_header Access-Control-Allow-Origin * always;
types { application/x-bittorrent torrent; }
try_files $uri =404;
}
# Папка фильмов (persistent volume смонтирован в /movies)
location /movies/ {
alias /movies/;
add_header Access-Control-Allow-Origin * always;
try_files $uri $uri/ =404;
}
# Плагин Lampa: нужен CORS, т.к. грузится с чужих origin (lampa.mx, bylampa.online)
location = /plugin.js {
add_header Access-Control-Allow-Origin * always;
default_type application/javascript;
try_files /plugin.js =404;
}
location / {
add_header Access-Control-Allow-Origin * always;
try_files $uri $uri/ =404;
}
}