Reputation: 139
I want to deploy Janus behind a frontend via Nginx server, that would act as a reverse proxy for incoming requests.
I'm using Ubuntu 18.04 and installed Janus correctly by documentation. The folder my Janus is installed is /opt/janus/ ....
I configure my server the following way
Server {
root /home/vsst/janus-gateway/html;
index index.html index.htm index.nginx-debian.html;
server_name janus.simpletask.dev;
location /opt/ {
proxy_pass http://84.201.181.191:8088/;
}
location / {
try_files $uri $uri/ =404;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/janus.simpletask.dev/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/janus.simpletask.dev/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = janus.simpletask.dev) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name janus.simpletask.dev;
return 404; # managed by Certbot
}
84.201.181.191 Is the public ip of my machine
I've also changed my Janus.js file variable server to var server = "/opt/janus"
according to https://groups.google.com/forum/#!topic/meetecho-janus/dIv-4s0HOdw
But after all manipulations I still have the message API call failed: [object Object],while trying to start any of the demo on site. So I can't use any demos provided by Janus. Please help to figure out what I'm doing wrong. Thanks a lot!
Upvotes: 1
Views: 3154
Reputation: 1
my configuration understand the difference between janus/ and janus.js
location ~* \.(ico|css|js|gif|jpe?g|png)$ {
expires 30d;
add_header Vary Accept-Encoding;
access_log off; }
location / {
try_files $uri $uri/ =404; }
location /janus {
proxy_pass http://127.0.0.1:8088/janus/; }
Upvotes: 0
Reputation: 41
I have been attempting to get this working, and seemed to solve a part of it. First of all, I use /rtc as the path, cause when I use just janus, my configuration didn't understand the difference between janus/ and janus.js:
location /rtc {
resolver 127.0.0.11 valid=30s;
set $upstream http://janus:8088;
rewrite ^/rtc(.*) /janus$1 break;
proxy_pass $upstream;
include /etc/nginx/proxy.conf;
access_log /var/log/nginx/access.janus.log;
error_log /var/log/nginx/error.janus.log warn;
}
The $upstream part is just to make sure nginx will start, even when my Janus docker instance is down. For me the rewrite part did the trick.
For completeness, proxy.conf contains the following:
proxy_http_version 1.1;
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-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
I got rid of the [object,object] message, but on echo test I don't get a working response yet.
Upvotes: 1