openpanel/configuration/nginx/vhosts/docker_apache_domain.conf
2024-09-18 16:27:40 +02:00

92 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 -->
##### /phmyadmin on #####
ProxyRequests Off
ProxyPreserveHost On
<Proxy>
Require all granted
</Proxy>
ProxyPass /phpmyadmin http://localhost:8080/
ProxyPassReverse /phpmyadmin http://localhost:8080/
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Ssl on
##### /phpmyadmin end #####
<Directory /home/<USER>/<DOMAIN_NAME>>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
DirectoryIndex index.php index.html
<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
##### /phmyadmin on #####
ProxyRequests Off
ProxyPreserveHost On
<Proxy>
Require all granted
</Proxy>
ProxyPass /phpmyadmin http://localhost:8080/
ProxyPassReverse /phpmyadmin http://localhost:8080/
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Ssl on
##### /phpmyadmin end #####
<Directory /home/<USER>/<DOMAIN_NAME>>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
DirectoryIndex index.php index.html
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/<PHP>-fpm.sock|fcgi://localhost"
</FilesMatch>
</VirtualHost>