2017-11-01 16:29:02 -07:00
|
|
|
upstream worker {
|
|
|
|
server ytdl:5002;
|
|
|
|
}
|
|
|
|
|
|
|
|
upstream backend {
|
2019-03-06 22:19:59 -08:00
|
|
|
server api:5001;
|
2017-11-01 16:29:02 -07:00
|
|
|
}
|
|
|
|
|
2018-12-25 01:23:16 -08:00
|
|
|
proxy_cache_path /tmp/nginx levels=1:2 keys_zone=feeds_cache:25m max_size=1g inactive=30m use_temp_path=off;
|
|
|
|
|
2017-10-24 16:57:59 -07:00
|
|
|
server {
|
2018-08-05 17:18:49 -07:00
|
|
|
listen 443;
|
2017-11-21 22:41:55 -08:00
|
|
|
|
2018-12-10 19:15:21 -08:00
|
|
|
root /var/www/;
|
|
|
|
index index.html;
|
|
|
|
|
2018-07-05 23:17:00 -07:00
|
|
|
server_name podsync.net;
|
2017-11-21 22:41:55 -08:00
|
|
|
|
2018-08-05 17:18:49 -07:00
|
|
|
ssl on;
|
2017-10-24 16:57:59 -07:00
|
|
|
ssl_certificate SSL_CERT;
|
|
|
|
ssl_certificate_key SSL_KEY;
|
2018-07-05 23:17:00 -07:00
|
|
|
ssl_trusted_certificate SSL_CHAIN_CERT;
|
2017-10-24 16:57:59 -07:00
|
|
|
|
|
|
|
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
|
|
|
|
|
|
|
|
access_log off;
|
|
|
|
|
2017-11-26 00:14:49 -08:00
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
|
|
|
2017-10-24 16:57:59 -07:00
|
|
|
location /download {
|
2019-03-12 18:38:52 -07:00
|
|
|
proxy_read_timeout 180s;
|
2017-11-01 16:29:02 -07:00
|
|
|
proxy_pass http://worker;
|
|
|
|
}
|
|
|
|
|
2018-12-25 13:38:18 -08:00
|
|
|
location = /api/webhooks {
|
2017-11-01 16:29:02 -07:00
|
|
|
proxy_pass http://backend;
|
|
|
|
client_max_body_size 128k;
|
2017-10-24 16:57:59 -07:00
|
|
|
}
|
|
|
|
|
2018-12-25 01:23:16 -08:00
|
|
|
location ~ (/user|/api) {
|
|
|
|
proxy_pass http://backend;
|
|
|
|
}
|
|
|
|
|
2017-10-24 16:57:59 -07:00
|
|
|
location / {
|
2018-12-21 16:36:34 -08:00
|
|
|
try_files $uri $uri.html $uri/ @backend;
|
2018-12-10 19:15:21 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
location @backend {
|
2018-12-25 01:23:16 -08:00
|
|
|
proxy_cache feeds_cache;
|
|
|
|
proxy_ignore_headers Cache-Control;
|
|
|
|
proxy_cache_valid 10m;
|
|
|
|
proxy_cache_lock on;
|
|
|
|
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
|
|
|
|
|
|
|
|
add_header X-Proxy-Cache $upstream_cache_status;
|
|
|
|
|
2017-11-01 16:29:02 -07:00
|
|
|
proxy_pass http://backend;
|
2017-10-24 16:57:59 -07:00
|
|
|
proxy_buffers 8 16k;
|
|
|
|
proxy_buffer_size 16k;
|
|
|
|
}
|
2018-08-05 17:18:49 -07:00
|
|
|
}
|