Add Apache2 instructions

This commit is contained in:
sunstep 2024-07-06 00:28:56 +02:00 committed by GitHub
parent 6eb27674b2
commit e2cdfdcbd3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,3 +36,40 @@ server {
}
```
### Apache2
For Apache2, you might need to enable some modules. Start by entering the following commands so the example configuration below works without any problems.
```
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod headers
```
With the above commands entered, the configuration below should work properly.
```
<VirtualHost *:80>
ServerName example.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Require all granted
</Proxy>
Header always set X-Real-IP %{REMOTE_ADDR}s
Header always set X-Forwarded-For %{REMOTE_ADDR}s
Header always set X-Forwarded-Proto https
Header always set X-Forwarded-Server %{SERVER_NAME}s
Header always set Host %{HTTP_HOST}s
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
</VirtualHost>
```
Please note that the above configurations are just examples and that they contain the minimum configuration needed to make the reverse proxy work properly. Feel free to adjust the configuration to your own needs.