49 lines
1.4 KiB
Markdown
49 lines
1.4 KiB
Markdown
|
---
|
|||
|
tags: ["apache2", "ubuntu", "docker"]
|
|||
|
---
|
|||
|
|
|||
|
```Shell
|
|||
|
sudo a2enmod proxy proxy_http proxy_balancer lbmethod_byrequests
|
|||
|
sudo nano /etc/apache2/sites-available/myhost.conf
|
|||
|
```
|
|||
|
|
|||
|
```
|
|||
|
# example.com заменить на свой адрес
|
|||
|
|
|||
|
<VirtualHost example.com:80>
|
|||
|
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]
|
|||
|
</VirtualHost>
|
|||
|
|
|||
|
# обязательно для SSL:
|
|||
|
#<IfModule mod_ssl.c>
|
|||
|
#<VirtualHost example.com:443>
|
|||
|
# 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
|
|||
|
#</VirtualHost>
|
|||
|
#</IfModule>
|
|||
|
|
|||
|
# Ctrl+O
|
|||
|
# Enter
|
|||
|
# Ctrl+X
|
|||
|
```
|
|||
|
|
|||
|
```Shell
|
|||
|
sudo a2ensite iptv
|
|||
|
# для подгрузки включенных модулей выполнить именно restart, а не reload
|
|||
|
sudo systemctl restart apache2
|
|||
|
```
|