{% if fpbx_alias is defined %}
Alias /{{ fpbx_alias }} {{ fpbx_root_dir }}/web/
{% else %}
# No alias defined, create a vhost to access it
{% endif %}

ProxyTimeout 900
RewriteEngine On
<Directory {{ fpbx_root_dir }}/web/>
  AllowOverride All
  Options FollowSymLinks
{% if fpbx_src_ip is defined %}
  Require ip {{ fpbx_src_ip | join(' ') }}
{% else %}
  Require all granted
{% endif %}
  <FilesMatch \.php$>
    SetHandler "proxy:unix:/run/php-fpm/{{ fpbx_php_fpm_pool  | default('freepbx') }}.sock|fcgi://localhost"
  </FilesMatch>
</Directory>
