fpm-pool.conf.j2 878 B

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