You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

5 years ago
  1. proxy_cache_path /var/cache/nginx/images levels=1:2 keys_zone=main_images:10m max_size=15g inactive=50d use_temp_path=on;
  2. proxy_cache_valid 200 1d;
  3. proxy_cache_valid 206 50d;
  4. server {
  5. listen 80;
  6. #listen 443 ssl http2;
  7. #ssl_certificate /etc/letsencrypt/live/predelanet.ru/fullchain.pem;
  8. #ssl_certificate_key /etc/letsencrypt/live/predelanet.ru/privkey.pem;
  9. server_name slave.predelanet.ru;
  10. access_log /var/log/nginx/slave.predelanet.ru/access.log main;
  11. error_log /var/log/nginx/slave.predelanet.ru/error.log warn;
  12. charset utf8;
  13. index index.php;
  14. root /usr/share/nginx/html/images;
  15. location / {
  16. return 403;
  17. }
  18. location ~ ^/media/cache/images/(.*) {
  19. try_files /$1 @main;
  20. }
  21. location @main {
  22. proxy_pass https://www.predelanet.ru;
  23. proxy_cache main_images;
  24. proxy_cache_key $host$uri$is_args$args;
  25. proxy_http_version 1.1;
  26. proxy_ignore_headers Cache-Control;
  27. #proxy_set_header Host $http_host;
  28. proxy_set_header X-Real-IP $remote_addr;
  29. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  30. }
  31. }