openpanel/configuration/nginx/vhosts/docker_apache_domain.conf
Stefan Pejcic 7357b75017 cleanup
2024-11-05 17:49:07 +01:00

82 lines
2.4 KiB
Plaintext

<VirtualHost *:80>
ServerName <DOMAIN_NAME>
ServerAlias www.<DOMAIN_NAME>
DocumentRoot /home/<USER>/<DOMAIN_NAME>
CustomLog /var/log/apache2/domlogs/<DOMAIN_NAME>.log combined
# <!-- BEGIN EXPOSED RESOURCES PROTECTION -->
<Directory /home/<USER>/<DOMAIN_NAME>>
<FilesMatch "\.(git|composer\.(json|lock)|auth\.json|config\.php|wp-config\.php|vendor)">
Require all denied
</FilesMatch>
</Directory>
# <!-- END EXPOSED RESOURCES PROTECTION -->
<Directory /home/<USER>/<DOMAIN_NAME>>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
DirectoryIndex index.php index.html default_page.html
# Alias for default_page.html
Alias /default_page.html /etc/apache2/default_page.html
<Directory "/etc/apache2">
<FilesMatch "^default_page.html$">
Require all granted
Options -Indexes
SetEnvIf Request_URI ^/default_page.html allow_default_page
</FilesMatch>
</Directory>
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/<PHP>-fpm.sock|fcgi://localhost"
</FilesMatch>
# Allow access to .well-known for Certbot
<Directory "/home/<USER>/<DOMAIN_NAME>/.well-known">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Alias /.well-known /home/<USER>/<DOMAIN_NAME>/.well-known
</VirtualHost>
<VirtualHost *:443>
ServerName <DOMAIN_NAME>
ServerAlias www.<DOMAIN_NAME>
DocumentRoot /home/<USER>/<DOMAIN_NAME>
CustomLog /var/log/apache2/domlogs/<DOMAIN_NAME>.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/cert.crt
SSLCertificateKeyFile /etc/apache2/ssl/cert.key
<Directory /home/<USER>/<DOMAIN_NAME>>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
DirectoryIndex index.php index.html default_page.html
# Alias for default_page.html
Alias /default_page.html /etc/apache2/default_page.html
<Directory "/etc/apache2">
<FilesMatch "^default_page.html$">
Require all granted
Options -Indexes
SetEnvIf Request_URI ^/default_page.html allow_default_page
</FilesMatch>
</Directory>
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/<PHP>-fpm.sock|fcgi://localhost"
</FilesMatch>
</VirtualHost>