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

43 lines
1.1 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)$">
SetHandler "proxy:unix:/run/php/php7.4-fpm-vpanel.sock|fcgi://localhost"
</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]
# deny direct access to html (template) files
<FilesMatch "\.(htm|html)$">
Deny from all
</FilesMatch>
# 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>