fpm-pool.conf.j2 868 B

1234567891011121314151617181920212223242526272829
  1. {% if ansible_controlled is defined and ansible_controlled != "" %}
  2. #
  3. # {{ ansible_controlled }}
  4. #
  5. {% endif %}
  6. {% if fpm_pools is defined and fpm_pools %}
  7. {% for pool in fpm_pools %}
  8. upstream fpm-backend-{{ pool }} {
  9. # Depending on the IP ensure that the same server will handle the request
  10. #ip_hash;
  11. {% for num in range(0, fpm_pools[pool].count, 1) %}
  12. server unix:/run/php/php{{ php_version }}-fpm-pool-{{ pool }}{{ num }}.sock;
  13. {% endfor %}
  14. }
  15. {% endfor %}
  16. {% else %}
  17. upstream fpm-backend {
  18. # Depending on the IP ensure that the same server will handle the request
  19. #ip_hash;
  20. {% for num in range(0, fpm_pool_count, 1) %}
  21. {% if ansible_lsb.major_release|int >= 9 %}
  22. server unix:/run/php/php{{ php_version }}-fpm-pool-www{{ num }}.sock;
  23. {% else %}
  24. server unix:/var/run/php5-fpm-pool-www{{ num }}.sock;
  25. {% endif %}
  26. {% endfor %}
  27. }
  28. {% endif %}