minimal-webrtc/nginx-site.example

42 lines
1.0 KiB
Plaintext

upstream minimal-webrtc {
# Set this to the actual path of the unix socket.
server unix:/var/run/minimal-webrtc.sock;
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
# Use self-signed certificate.
ssl_certificate /etc/ssl/certs/localhost.crt;
ssl_certificate_key /etc/ssl/private/localhost.key;
ssl_protocols TLSv1.2;
root /var/www/html-ssl;
index index.html;
server_name _;
location /camera/ {
alias /path/to/minimal-webrtc/wwwroot/;
try_files $uri $uri/ @minimal_webrtc;
}
location @minimal_webrtc {
proxy_pass http://minimal-webrtc;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
# This header has to match the settings.py file.
proxy_set_header X-Forwarded-Proto $scheme;
}
}