Browse Source

Add example nginx configuration.

tags/blog-initial
Daniel Perelman 5 months ago
parent
commit
a8fd1ac7e9
1 changed files with 40 additions and 0 deletions
  1. +40
    -0
      nginx-site.example

+ 40
- 0
nginx-site.example View File

@@ -0,0 +1,40 @@
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 / {
try_files $uri $uri/ @proxy_to_app;
}
location @proxy_to_app {
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;
}
}

Loading…
Cancel
Save