doc: apache configuration example

This commit is contained in:
Éloi Rivard 2024-08-16 09:41:05 +02:00
parent 03911680d1
commit da6a3b2e68
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184

View file

@ -113,9 +113,41 @@ Nginx
Apache
------
.. todo::
.. code-block:: apache
Write a Apache configuration file.
<VirtualHost *:80>
ServerName auth.mydomain.tld
ServerAdmin admin@mydomain.tld
CustomLog /opt/canaille/logs/apache-http-access.log combined
ErrorLog /opt/canaille/logs/apache-http-error.log
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L] </VirtualHost>
</VirtualHost>
<VirtualHost *:443>
ServerName auth.mydomain.tld
ServerAdmin admin@mydomain.tld
Protocols h2 http/1.1
CustomLog /opt/canaille/logs/apache-https-access.log combined
ErrorLog /opt/canaille/logs/apache-https-error.log
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/auth.mydomain.tld/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/auth.mydomain.tld/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
ProxyPreserveHost On
ProxyPass /static/ !
ProxyPass / unix:/etc/canaille/uwsgi.sock
ProxyPassReverse / unix:/etc/canaille/uwsgi.sock
RequestHeader set X-FORWARDED-PROTOCOL ssl
RequestHeader set X-FORWARDED-SSL on
</VirtualHost>
Recurrent jobs
==============