-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
WebRTC behind reverse proxy broken in upgrade 1.6.0 to 1.7.0 #3649
Comments
Hello, between v1.6.0 and v1.7.0 we were forced to perform a change in the This broke compatibility with reverse proxies that put a prefix before every URL, like yours. In order to fix the issue, you have to edit your reverse proxy in order to intercept the Location header in responses and put the prefix before its value too, for instance, you have to edit this:
Into this:
If you are using nginx as reverse proxy, you can do it in this way (more or less):
|
@aler9 why not add a prefix in the mediamtx settings? |
@andreymal because that would mean maintaining and bug-fixing an additional feature that is already provided in a better form by another component, and belongs to that other component. |
No better, nginx can't properly add prefixes in response bodies, for example. So I suspect that one day you will have to implement this additional feature |
For future reference, how to do it with Apache httpd: <Location /abc>
ProxyPass http://10.132.0.6:8889
ProxyPassReverse http://10.132.0.6:8889
Header edit Location ^(.*)$ "/abc$1"
</Location> You need to use the |
TBH the general recommendation should be to put the reverse-proxied service in its own domain. MediaMTX is not the only one that does not like living in a proxied folder (Grafana is another). |
@elvis-epx I use |
WebRTC ceased to work when published through a reverse proxy
Which version are you using?
v1.8.5
Which operating system are you using?
Describe the issue
After upgrading from 1.4.2 to 1.8.5, the WebRTC ceased to work when it is published as a folder of external site using a reverse proxy (nginx). Internal access (direct to LAN IP) works normally.
The NGINX logs show that PATCH and DELETE are being sent to the root URL /camera/whep, while in 1.4.2 there is only the PATCH request (not DELETE) that goes to the correct URL /revproxy_folder/camera/whep
Edit: upgrade up to 1.6.0 keeps things working. Upgrade to 1.7.0 triggers the issue.
Describe how to replicate the issue
Did you attach the server logs?
no
Did you attach a network dump?
yes (NGINX logs)
teste.txt
The text was updated successfully, but these errors were encountered: