2022-08-23 13:48:42 +02:00

74 lines
2.3 KiB
Nginx Configuration File

# This NGNIX configuration is prepared to work against application openvidu-hello-world
# (https://github.com/OpenVidu/openvidu-tutorials/tree/master/openvidu-hello-world) being
# served on port 8080. For compatibility with other web applications, adaptations might
# be needed on elements http>upstream and http>server>location
events {
worker_connections 512;
}
http {
upstream openvidu-deployment {
server host.docker.internal:4443;
}
upstream server-application {
server host.docker.internal:5000;
}
upstream iframe-application {
server host.docker.internal:8081;
}
upstream client-application {
server host.docker.internal:8080;
}
server {
listen 443 ssl;
ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/key.pem;
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-Proto $scheme;
proxy_set_header X-Forwarded-Proto https;
proxy_headers_hash_bucket_size 512;
proxy_redirect off;
# Websockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# OpenVidu deployment API
location /openvidu/api {
proxy_pass http://openvidu-deployment;
}
# OpenVidu WebSocket
location ~ /openvidu$ {
proxy_pass http://openvidu-deployment;
}
# Server application requests
location /api/ {
proxy_pass http://server-application;
}
# Iframe application requests
location / {
proxy_pass http://iframe-application;
}
# Client application requests. This is specific to application openvidu-hello-world
location /hello-world {
proxy_pass http://client-application/;
}
location /app.js {
proxy_pass http://client-application;
}
location /style.css {
proxy_pass http://client-application;
}
location ~ /openvidu-browser-.+\.js {
proxy_pass http://client-application;
}
}
}