28 lines
945 B
Plaintext
Raw Normal View History

2021-12-01 19:13:34 +01:00
{% if glpi_alias is defined %}
2023-04-13 10:00:14 +02:00
Alias /{{ glpi_alias }} {{ glpi_root_dir }}/web/public
2021-12-01 19:13:34 +01:00
{% else %}
# No alias defined, create a vhost to access it
{% endif %}
2023-04-13 10:00:14 +02:00
<Directory {{ glpi_root_dir }}/web/public>
2021-12-01 19:13:34 +01:00
AllowOverride All
Options FollowSymLinks
{% if glpi_src_ip is defined %}
Require ip {{ glpi_src_ip | join(' ') }}
{% else %}
Require all granted
{% endif %}
2023-04-13 10:00:14 +02:00
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L,QSA]
2021-12-01 19:13:34 +01:00
<FilesMatch \.php$>
2023-04-13 10:00:14 +02:00
# For some (unknown) reason, files at the root like apirest.php won't be handled by the rewrite rule
# So force SCRIPT_NAME here (except for sso.php which is in the public subdir)
ProxyFCGISetEnvIf "reqenv('Request_URI') !~ m/sso\.php$/" SCRIPT_FILENAME "{{ glpi_root_dir }}/web/public/index.php"
2021-12-01 19:13:34 +01:00
SetHandler "proxy:unix:/run/php-fpm/{{ glpi_php_fpm_pool | default('glpi_' + glpi_id | string) }}.sock|fcgi://localhost"
</FilesMatch>
</Directory>