fpm_service.conf.j2 760 B

12345678910111213141516171819202122232425262728293031
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. listen 443 ssl http2;
  5. server_name {{item.server_name}};
  6. root {{item.root | default('/var/www/html/')}};
  7. index index.html index.html index.htm index.php;
  8. # keepalive_timeout 200;
  9. {{item.custom_config | default('') | indent(2)}}
  10. location / {
  11. try_files $uri $uri/ /index.php?$args;
  12. }
  13. location ~ \.php$ {
  14. include snippets/fastcgi-php.conf;
  15. fastcgi_pass {{item.proxy_pass | default('unix:/run/php/php7.4-fpm.sock')}};
  16. {{item.custom_fastcgi_config | default('') | indent(2)}}
  17. }
  18. # compression
  19. gzip on;
  20. gzip_types text/plain application/xml application/json;
  21. gzip_proxied no-cache no-store private expired auth;
  22. gzip_min_length 1000;
  23. # cache
  24. proxy_cache STATIC;
  25. }