|
|
|
First install nginx
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install nginx
|
|
|
|
```
|
|
|
|
|
|
|
|
It is important, that nginx is not listening to the same port as PrivMX server is listening to (defined in `/etc/privmx-team-server/config.json`)
|
|
|
|
|
|
|
|
Create file with you virtual host `/etc/nginx/sites-available/your.domain.com.conf`
|
|
|
|
```
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
|
|
|
|
|
|
|
root /var/www/html;
|
|
|
|
index index.html;
|
|
|
|
client_max_body_size 10M;
|
|
|
|
|
|
|
|
server_name your.domain.com;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_pass http://127.0.0.1:PRIVMX_PORT;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "Upgrade";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Enable your site
|
|
|
|
```
|
|
|
|
ln -s /etc/nginx/sites-available/your.domain.com.conf /etc/nginx/sites-enabled/
|
|
|
|
```
|
|
|
|
|
|
|
|
Restart nginx
|
|
|
|
```
|
|
|
|
sudo service nginx restart
|
|
|
|
```
|
|
|
|
|
|
|
|
That's all! |
|
|
|
\ No newline at end of file |