Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web request redirected to turn server on fresh Debian10 Installation #6353

Closed
ClundXIII opened this issue Apr 24, 2020 · 14 comments
Closed

Web request redirected to turn server on fresh Debian10 Installation #6353

ClundXIII opened this issue Apr 24, 2020 · 14 comments
Labels
packaging Issue related to packaging or build topics wontfix Issue won't be fixed

Comments

@ClundXIII
Copy link

ClundXIII commented Apr 24, 2020

Description

After an upgrade my installation stopped working with a 502 error. I then did a fresh reinstalled and observed the exact same behaviour. It seems like /etc/nginx/modules-enabled/60-jitsi-meet.conf does exactly the configured behaviour and redirects all traffic per default to the turnserver:

    upstream web {
        server 127.0.0.1:4444;
    }
    upstream turn {
        server 127.0.0.1:4445;
    }
    # since 1.13.10
    map $ssl_preread_alpn_protocols $upstream {
        ~\bh2\b         web;
        ~\bhttp/1\.     web;
        default         turn;
    }

The nginx error log (on the jitsi vm):

2020/04/24 16:08:38 [error] 1066#1066: *75 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.101.111, server: 0.0.0.0:443, upstream: "127.0.0.1:4445", bytes from/to client:0/0, bytes from/to upstream:0/0

Current behavior

nginx redirects main page and room links to turn server

Expected Behavior

I would like to see the welcome page

Possible Solution

Fix the nginx config

Steps to reproduce

Do a fresh install on debian 10.3

Environment details

Debian 10.3 behind a NAT and web proxy.

client <-- [https] --> web proxy <--[https]--> jitsi vm

@ClundXIII ClundXIII changed the title Fresh Debian10 Installation fails with proxy error Web request redirected to turn server on fresh Debian10 Installation Apr 24, 2020
@dpoon
Copy link
Contributor

dpoon commented Apr 26, 2020

The nginx configuration was recently changed in #5649, but that is likely not the cause of this problem. Rather, I would suspect that it improves on a situation introduced in commit b991f05 by @damencho (#4959), which added the coturn server sharing TCP port 443 using ALPN as a switch.

@dpoon
Copy link
Contributor

dpoon commented Apr 26, 2020

What web proxy are you using, and is it capable of doing ALPN?

@ClundXIII
Copy link
Author

Ahhh that explains a lot. Then I guess I just need additional config for my proxy?

What web proxy are you using, and is it capable of doing ALPN?

I am using nginx v 1.14.2-2+deb10u1

@ClundXIII
Copy link
Author

ClundXIII commented Apr 26, 2020

This is my current nginx config:

        location / {
            #proxy_http_version 1.1;
            #proxy_set_header Upgrade $http_upgrade;
            #proxy_set_header Connection "upgrade";
            proxy_set_header Host $http_host;

            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forward-Proto http;
            proxy_set_header X-Nginx-Proxy true;

            proxy_pass https://meet.<url>;
            proxy_ssl_verify off;
        }

@dpoon
Copy link
Contributor

dpoon commented Apr 26, 2020

If jitsi-meet comes with an nginx reverse proxy, and you have your own nginx reverse proxy in front of that, then that seems a bit silly. Two suggested solutions:

  • get rid of your own proxy, or
  • keep your own proxy, but reconfigure it to proxy straight to either port 4444 or 4445 using ALPN-based switching, effectively bypassing jitsi-meet's proxy.

@ClundXIII
Copy link
Author

ClundXIII commented Apr 27, 2020

My current setup just forwards some ports. Yes.

I cannot get rid of the first proxy, there is A LOT of stuff running on the machine. Multiple websites and services that share the same IP address. What configs do I need to change in order to keep the current solution working with port forwarding? Is there a dpkg-reconfigure that takes care of this?

Is there a way to do this with the dockerized version as well? Because I have a second jitsi server (that needs awt support) which runs via docker with different ports.

Alternatively I could get a new IP Address which I would prefer not to do.

@ClundXIII
Copy link
Author

Any Update on this?

What configs do I need to change in order to keep the current solution working with port forwarding?

@Monty811
Copy link

Monty811 commented May 4, 2020

Hi everyone, have a similar issue while trying to set up config in AWS with a AWS application load balancer in front of Jitsi.
My problem there is that I am not able to do ALPN switching there directly as the rules for ALPN switching are not configurable (as far as I understand the docs).
I thought that somewhere within the Jitsi conf there could be the possibility to set another subdomain like turn.jitsi.example.com to route turn server requests based on the subdomain.
The above config wihtin nginx seems to be smarter but having problems to achive it when having another proxy like AWS LB in front of it

@garrettboone
Copy link

This thread helped. I was working with the ssllabs.com server test and could not get past a B grade because of this...and couldn't figure out what it was reporting such low ciphers being used. The nginx error.log was full of "recv() failed" messages. I changed to default web and am now getting an A+.

@ghost
Copy link

ghost commented May 18, 2020

The default here seems to be wrong, a lot of HTTP clients don't supply the ALPN extension. This may be a possible fix although I haven't tested extensively yet (see RFC7743):

    map $ssl_preread_alpn_protocols $upstream {
        ~\bstun\.turn\b  turn;
        default          web;
    }

@damencho
Copy link
Member

Chrome currently does not add ALPN to the turn TCP connection, we had opened an issue there.

@damencho
Copy link
Member

@saghul saghul added the packaging Issue related to packaging or build topics label May 26, 2020
@stale
Copy link

stale bot commented Aug 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Issue won't be fixed label Aug 24, 2020
@stale stale bot closed this as completed Aug 31, 2020
@Echolon Echolon removed the wontfix Issue won't be fixed label Aug 31, 2020
@Echolon Echolon reopened this Aug 31, 2020
@stale
Copy link

stale bot commented Dec 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Issue won't be fixed label Dec 4, 2020
@stale stale bot closed this as completed Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Issue related to packaging or build topics wontfix Issue won't be fixed
Projects
None yet
Development

No branches or pull requests

7 participants