Advertisement
poiuty

anilibria_cache_vhost

Nov 6th, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. server {
  2. listen 85;
  3. keepalive_timeout 30;
  4. root /var/cache/munin/www/;
  5. location /munin/static/ {
  6. alias /etc/munin/static/;
  7. }
  8. location ^~ /munin-cgi/munin-cgi-graph/ {
  9. access_log off;
  10. fastcgi_split_path_info ^(/munin-cgi/munin-cgi-graph)(.*);
  11. fastcgi_param PATH_INFO $fastcgi_path_info;
  12. fastcgi_pass unix:/var/run/munin/fcgi-graph.sock;
  13. include fastcgi_params;
  14. }
  15. }
  16.  
  17. server {
  18. listen 80;
  19. listen 443 ssl http2;
  20. server_name test.anilibria.tv;
  21. ssl_certificate /etc/letsencrypt/live/test.anilibria.tv/fullchain.pem;
  22. ssl_certificate_key /etc/letsencrypt/live/test.anilibria.tv/privkey.pem;
  23. location ~* \.(m3u8|ts)$ {
  24. access_log /var/log/nginx/cache-access.log cache;
  25. proxy_pass http://x.anilibria.tv;
  26. proxy_cache STATIC;
  27. proxy_cache_valid 404 302 1m;
  28. proxy_cache_valid 200 1y;
  29. proxy_ignore_headers Set-Cookie Expires Cache-Control;
  30. proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
  31.  
  32. # clean cache curl https://test.anilibria.tv/videos/ts/4576/0001/fff1.ts -s -I -H "965f76362acf00a460d86c8b40911ca2:true"
  33. proxy_cache_bypass $http_965f76362acf00a460d86c8b40911ca2;
  34.  
  35. add_header X-Cache-Status $upstream_cache_status; # show cache status
  36. # dont block process
  37. # https://img.poiuty.com/img/08/e75c6adde3ee57e4bff48a3bc0b70908.png
  38. # https://img.poiuty.com/img/1d/adbe5915344c83528f0b1a6bbac2951d.png
  39. # https://nginx.org/ru/docs/http/ngx_http_core_module.html#aio
  40. # https://habrahabr.ru/post/260669/
  41. #aio threads;
  42. #aio_write on;
  43. #sendfile_max_chunk 512k;
  44. }
  45. location /.well-known/ { # letsencrypt
  46. root /var/www/html;
  47. }
  48. location / {
  49. return 403;
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement