mirror of
https://github.com/linuxserver/fanart-nginx.git
synced 2026-01-27 19:14:34 +08:00
91 lines
2.3 KiB
Plaintext
91 lines
2.3 KiB
Plaintext
|
|
# redirect all traffic to https
|
|
server {
|
|
listen 80;
|
|
set_by_lua $serverurl 'return os.getenv("URL")';
|
|
server_name $serverurl;
|
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
set_by_lua $validator 'return os.getenv("VALIDATOR")';
|
|
if ($validator = "false") {
|
|
set_by_lua $validatorip 'return os.getenv("VALIDATORIP")';
|
|
return 302 http://$validatorip$request_uri;
|
|
}
|
|
if ($validator = "true") {
|
|
root /config/www;
|
|
}
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
}
|
|
|
|
# main server block
|
|
server {
|
|
listen 443 ssl http2 default_server;
|
|
|
|
root /config/www;
|
|
index index.html index.htm index.php;
|
|
|
|
set_by_lua $serverurl 'return os.getenv("URL")';
|
|
server_name $serverurl;
|
|
|
|
ssl_certificate /config/keys/letsencrypt/fullchain.pem;
|
|
ssl_certificate_key /config/keys/letsencrypt/privkey.pem;
|
|
ssl_dhparam /config/nginx/dhparams.pem;
|
|
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
client_max_body_size 0;
|
|
|
|
add_header X-Cache-Status $upstream_cache_status;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html =404;
|
|
}
|
|
|
|
location /fanart/ {
|
|
|
|
proxy_pass https://fanart.tv;
|
|
|
|
proxy_cache my_cache;
|
|
proxy_cache_revalidate on;
|
|
proxy_ignore_headers Cache-Control;
|
|
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
|
|
proxy_cache_lock on;
|
|
proxy_cache_valid 200 301 302 86400m;
|
|
proxy_cache_valid 404 30m;
|
|
}
|
|
|
|
location /preview/ {
|
|
|
|
proxy_pass https://fanart.tv;
|
|
|
|
proxy_cache my_cache;
|
|
proxy_cache_revalidate on;
|
|
proxy_ignore_headers Cache-Control;
|
|
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
|
|
proxy_cache_lock on;
|
|
proxy_cache_valid 200 301 302 86400m;
|
|
proxy_cache_valid 404 30m;
|
|
}
|
|
|
|
location /bigpreview/ {
|
|
|
|
proxy_pass https://fanart.tv;
|
|
|
|
proxy_cache my_cache;
|
|
proxy_cache_revalidate on;
|
|
proxy_ignore_headers Cache-Control;
|
|
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
|
|
proxy_cache_lock on;
|
|
proxy_cache_valid 200 301 302 86400m;
|
|
proxy_cache_valid 404 30m;
|
|
}
|
|
|
|
|
|
}
|
|
|