Add ability to PURGE the cache
[akkoma] / installation / pleroma.nginx
1 proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=10g
2 inactive=720m use_temp_path=off;
3
4 server {
5 listen 80;
6 server_name example.tld;
7 return 301 https://$server_name$request_uri;
8 }
9
10 server {
11 listen 443;
12 ssl on;
13 ssl_session_timeout 5m;
14
15 ssl_certificate /etc/letsencrypt/live/exmaple.tld/fullchain.pem;
16 ssl_certificate_key /etc/letsencrypt/live/example.tld/privkey.pem;
17
18 ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
19 ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
20 ssl_prefer_server_ciphers on;
21
22 server_name example.tld;
23
24 location / {
25 add_header 'Access-Control-Allow-Origin' '*';
26 proxy_http_version 1.1;
27 proxy_set_header Upgrade $http_upgrade;
28 proxy_set_header Connection "upgrade";
29 proxy_set_header Host $http_host;
30
31 proxy_pass http://localhost:4000;
32 }
33
34 location /proxy {
35 proxy_cache pleroma_media_cache;
36 proxy_cache_lock on;
37 proxy_pass http://localhost:4000;
38 }
39
40 }