self-hosting/roles/forgejo/templates/apache2/vhost.conf.j2

30 lines
1 KiB
Text
Raw Normal View History

2023-10-01 17:30:38 +02:00
<VirtualHost *:80>
ServerName {{ forgejo_domain }}
ServerAdmin {{ forgejo_server_admin }}
DocumentRoot /var/www/empty
RewriteEngine on
RewriteCond %{SERVER_NAME} ={{ forgejo_domain }}
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
ErrorLog ${APACHE_LOG_DIR}/{{ forgejo_domain }}.error.log
CustomLog ${APACHE_LOG_DIR}/{{ forgejo_domain }}.access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName {{ forgejo_domain }}
ServerAdmin {{ forgejo_server_admin }}
ProxyPreserveHost On
ProxyRequests off
AllowEncodedSlashes NoDecode
ProxyPass / http://localhost:3000/ nocanon
ProxyPassReverse / http://localhost:3000/
ErrorLog ${APACHE_LOG_DIR}/{{ forgejo_domain }}.error.log
CustomLog ${APACHE_LOG_DIR}/{{ forgejo_domain }}.access.log combined
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/{{ forgejo_domain }}/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/{{ forgejo_domain }}/privkey.pem
</VirtualHost>