Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=fpmcache:100m max_size=10g inactive=60m use_temp_path=off;
  2. fastcgi_cache_key "$request_uri|$request_body";
  3. fastcgi_cache_methods POST;
  4. server {
  5. server_tokens off;
  6. listen 80 default_server;
  7. server_name server_name _;
  8.  
  9. access_log /dev/stdout;
  10. error_log /dev/stderr;
  11.  
  12. root /opt/code;
  13.  
  14. location / {
  15. try_files $uri /index.php$is_args$args;
  16. }
  17.  
  18. set $disable_cache 1;
  19. if ($request_uri ~ "^/cache") {set $disable_cache 0;}
  20.  
  21. location ~ [^/]\.php(/|$) {
  22. fastcgi_cache_bypass $disable_cache;
  23. fastcgi_no_cache $disable_cache;
  24.  
  25. fastcgi_cache fpmcache;
  26. fastcgi_cache_valid 200 15m;
  27. fastcgi_cache_min_uses 1;
  28. fastcgi_cache_lock on;
  29. add_header X-FastCGI-Cache $upstream_cache_status;
  30.  
  31. #basic fpm settings
  32. fastcgi_pass fpm:9000;
  33. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  34. fastcgi_read_timeout 35;
  35. include fastcgi_params;
  36. fastcgi_param DOCUMENT_ROOT $realpath_root;
  37. fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement