---
tags: ["apache2", "ubuntu", "docker"]
---
```Shell
sudo a2enmod proxy proxy_http proxy_balancer lbmethod_byrequests
sudo nano /etc/apache2/sites-available/myhost.conf
```
```
# example.com заменить на свой адрес
ServerName example.com
# обязательно без SSL:
ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
# обязательно для SSL:
# RewriteEngine on
# RewriteCond %{SERVER_NAME} =example.com
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
# обязательно для SSL:
#
#
# ServerName example.com
# ProxyPreserveHost On
# ProxyPass / http://localhost:8080/
# ProxyPassReverse / http://localhost:8080/
# сертификаты можно получить через certbot
# SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
# SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
# Include /etc/letsencrypt/options-ssl-apache.conf
#
#
# Ctrl+O
# Enter
# Ctrl+X
```
```Shell
sudo a2ensite iptv
# для подгрузки включенных модулей выполнить именно restart, а не reload
sudo systemctl restart apache2
```