vpanel-stack/etc/apache2/conf-available/vpanel.conf

45 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-07-01 15:24:26 -07:00
Alias /panel /srv/www/html/panel
<Directory /srv/www/html/panel>
# panel php-fpm worker
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
2022-08-31 10:28:20 -07:00
SetHandler "proxy:unix:/run/php/php8.1-fpm-vpanel.sock|fcgi://localhost"
2022-07-01 15:24:26 -07:00
</FilesMatch>
# Enable rewrite engine
RewriteEngine On
# force https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Some servers require you to specify the `RewriteBase` directive
# In such cases, it should be the path (relative to the document root)
# containing the index file
RewriteBase /panel
# return 404 Not Found (effectively blocking access) to:
# classes/
# config/
# f3/
# tmp/
# all hidden files and dirs (anything beginning with a .)
RewriteRule ^(classes|config|f3|tmp)\/|^\.|^/\. - [R=404]
# Route requests to the framework
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</Directory>
# deny direct access to html (template) files
<Directory /srv/www/html/panel/ui>
<FilesMatch "\.(htm|html)$">
Deny from all
</FilesMatch>
</Directory>