Create a new virtual host
sudo nano /etc/apache2/sites-available/pixelfed.cogip.be.conf
And paste these lines
<VirtualHost *:80>
ServerName pixelfed.cogip.be
DocumentRoot /usr/share/webapps/pixelfed/public
<Directory /usr/share/webapps/pixelfed/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/pixelfed-cogip-be.error.log
CustomLog ${APACHE_LOG_DIR}/pixelfed-cogip-be.access.log combined
# Real client IP and protocol
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 192.168.0.80
# Original scheme is HTTPS
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Ssl "on"
# Send requests for PHP files to the PHP-FPM socket
ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/run/php/pixelfed.sock|fcgi://localhost/usr/share/webapps/pixelfed/public/
</VirtualHost>
Enable the virtual host and disable the default Apache website
sudo a2ensite pixelfed.cogip.be.conf
sudo a2dissite 000-default.conf
And restart Apache
sudo systemctl reload apache2