mirror of
https://github.com/TeamPiped/Piped-Docker.git
synced 2024-12-12 21:30:41 +05:30
Use nginx to cache responses.
This commit is contained in:
parent
0a6f6c557b
commit
2480d0dffb
@ -22,19 +22,6 @@ services:
|
||||
depends_on:
|
||||
- postgres
|
||||
container_name: piped-backend
|
||||
varnish:
|
||||
image: varnish:7.0-alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./config/default.vcl:/etc/varnish/default.vcl:ro
|
||||
container_name: varnish
|
||||
depends_on:
|
||||
- piped
|
||||
healthcheck:
|
||||
test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed || (varnishreload && exit 1)"
|
||||
interval: 10s
|
||||
timeout: 10s
|
||||
retries: 1
|
||||
nginx:
|
||||
image: nginx:mainline-alpine
|
||||
restart: unless-stopped
|
||||
@ -50,7 +37,6 @@ services:
|
||||
container_name: nginx
|
||||
depends_on:
|
||||
- piped
|
||||
- varnish
|
||||
- ytproxy
|
||||
- pipedfrontend
|
||||
postgres:
|
||||
|
@ -1,10 +1,13 @@
|
||||
proxy_cache_path /tmp/pipedapi_cache levels=1:2 keys_zone=pipedapi:4m max_size=2g inactive=60m use_temp_path=off;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name BACKEND_HOSTNAME;
|
||||
|
||||
set $backend "http://varnish:80";
|
||||
set $backend "http://piped:8080";
|
||||
|
||||
location / {
|
||||
proxy_cache pipedapi;
|
||||
proxy_pass $backend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "keep-alive";
|
||||
|
Loading…
Reference in New Issue
Block a user