bổ sung apache
This commit is contained in:
+34
@@ -153,6 +153,40 @@ server {
|
||||
}
|
||||
```
|
||||
|
||||
Ví dụ Apache VirtualHost tối thiểu:
|
||||
|
||||
```apache
|
||||
<VirtualHost *:80>
|
||||
ServerName _
|
||||
DocumentRoot /opt/ipcam-dashboard/dist
|
||||
|
||||
<Directory /opt/ipcam-dashboard/dist>
|
||||
Options Indexes FollowSymLinks
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^ /index.html [L]
|
||||
|
||||
ProxyPreserveHost On
|
||||
ProxyPass /api/ http://127.0.0.1:8008/api/
|
||||
ProxyPassReverse /api/ http://127.0.0.1:8008/api/
|
||||
|
||||
ProxyPass /videos/ http://127.0.0.1:8008/videos/
|
||||
ProxyPassReverse /videos/ http://127.0.0.1:8008/videos/
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
Apache cần bật module trước khi reload:
|
||||
|
||||
```bash
|
||||
sudo a2enmod rewrite proxy proxy_http
|
||||
sudo systemctl reload apache2
|
||||
```
|
||||
|
||||
## 5) Systemd service (khuyến nghị)
|
||||
|
||||
### 5.1 Backend service
|
||||
|
||||
Reference in New Issue
Block a user