Seite anzeigenÄltere VersionenLinks hierherNach oben Diese Seite ist nicht editierbar. Sie können den Quelltext sehen, jedoch nicht verändern. Kontaktieren Sie den Administrator, wenn Sie glauben, dass hier ein Fehler vorliegt. <markdown> # ReverseProxy on Apache2 Server ## To a Subpath This creates a subpath behind the domain of your server. For example `https://ismus.net/gitea`. ([source](https://docs.gitea.io/en-us/reverse-proxies/#using-apache-httpd-with-a-sub-path-as-a-reverse-proxy)) 1. In `/etc/apache2/conf-available` create a fitting .conf-file for your service. Here e.g. for gitea </markdown> <cli> <Location /gitea> ProxyPass http://localhost:3000 nocanon ProxyPassReverse http://localhost:3000 </Location> </cli> <markdown> 2. Don't forget to activate the config with `sudo a2enconf gitea` resp. your conf-file. 3. Of course you may have to `sudo systemctl reload apache2` your server to have it work. ## To a Subdomain 1. In `/etc/apache2/sites-available` create a new file with `<subdomain>.conf`. 2. It should look like that (here with a local server listening to port 3000) </markdown> <cli> <IfModule mod_ssl.c> <VirtualHost *:443> ProxyPreserveHost On ProxyPass "/" "http://localhost:3000/" ProxyPassReverse "/" "http://localhost:3000/" ServerName subdomain.yourserver.net TransferLog /var/log/apache2/access.log ErrorLog /var/log/apache2/error.log SSLCertificateFile /etc/letsencrypt/live/yourserver.net/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/yourserver.net/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> </IfModule> </cli> <markdown> 3. Activate this config by `sudo a2ensite subdomain` and 4. `sudo systemctl reload apache2` </markdown> apache2reverseproxy.txt Zuletzt geändert: 2021/03/27 15:04von homer