jitsi-meet: Jitsi cannot be run from a subdirectory
This Issue tracker is only for reporting bugs and tracking code related issues.
Before posting, please make sure you check community.jitsi.org to see if the same or similar bugs have already been discussed. General questions, installation help, and feature requests can also be posted to community.jitsi.org.
Description
Before closing this and referring to a previous issue, please consider I am a Systems Admin and have been writing JS for 7 years.
I’m VERY familiar with Nginx and how to configure it. The solution is not the web server. It may be Jitsi configuration I’ve overlooked.
It seems impossible to just run Jitsi not as the root application - I don’t mean simply running it from a subdirectory, I mean running it as https://domain.com/jitsi-is-here/ vs. at domain URL root.
A subdomain is not a solution. This unnecessarily complicates using an SSL which is already configured for Jitsi. We should not need a separate server or SSL just for Jitsi.
Current behavior
Running Jitsi in a location other than web root results in Jitsi exhibiting behavior that is in contrast with what you (Jitsi devs) have stated here:
https://github.com/jitsi/jitsi-meet/issues/2422
… which is that you simply have to configure the web server.
When I provide the Jitsi Meet files in /api and try to hit my server at https://myserver.com/api, it fails to find files in relative paths - Jitsi fails to find them and update the relative paths.
This is evidenced by following the Nginx logs. Hitting my own app, for example and hitting relative paths in the URL, files load as expected, without issue; I am not rewriting or controlling the URL inside my app because this causes problems - as it appears Jitis is.
Instead of looking for it’s files in the root of the path where Jitsi lives, it’s looking for them at the server root.
If I wanted, for example to run my site on mysite.com/ and run Jitsi at mysite.com/api the result is that Jitsi looks for it’s configuration and other files at mysite.com/ even though it is physically located in /api.
Nginx is configured to provide a path to /api. Its root is configured for /usr/share/mysite. The /api path is alias /usr/share/mysite/api which is the physical location of Jitsi Meet.
Jitsi doesn’t seem to care that it’s index.html loads from mysite.com/api; (it loads broken, but it loads - i.e. the web server is doing it’s job) it still tries to path all of it’s files relative to web root.
This is common configurable behavior (see: every CMS every created, exa. Wordpress, nearly every JVM app every created, see: Graylog, and many, many others) where you can usually set a base or root URL. There doesn’t seem to be a configuration option for this.
However, I see this as a bug not because it can’t be configured but because the behavior seems to ignore its own relative path. This doesn’t make much sense.
If it is configurable, please let me know how, in detail I can configure this and I guess this could be closed.
Expected Behavior
I should be able to use a subpath URL to use as Jitsi’s root. Jitsi should not expect to be on the root or it should adapt.
Simply stated, I should be able to put Jitsi anywhere on my server, point the web server to this location and Jitsi should run.
Possible Solution
- Stop trying to force the relative path in your application.
- Provide a specific configuration for using an alternate base URL (not web server config but application config).
- Don’t assume your app will be on the web root.
Steps to reproduce
Move Jitsi Meet into a subdirectory. Configure Nginx to point to this directory on a non-web root path. Visit that URL and watch Jitsi break.
Environment details
Debian Stretch.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 31 (7 by maintainers)
I’ve been trying, without success, to accomplish this as well for a few days now. Can you reopen the issue @saghul ?
I really need this reopened as well. I want to run a Jitsi server that can only be used by a very select few people. My solution to this is running in at
https://domain/<secret>/but I can’t make this work. This is perfectly secure if I always use a secure channel to transfer the URL to just the people I want to have access, and it avoids annoying authentication hassles.This other guy wants to do the same thing: https://community.jitsi.org/t/how-to-modify-nginx-setup-in-order-to-use-a-soft-link-to-start-jitsi-meet/22880
I don’t see how that’s the case.
How is this a problem in 2019? With Let’s Encrypt you pretty much don’t need to do anything.
One CNAME is enough, since you are going to handle it in your own server.
Not really if you proxy it from your own domain.
Agreed. I’m just trying to help you here, while this is solved on our side. This is not a feature that sees much use really so I can’t promise you a speedy solution.
We have different understandings of “embedding”. What we mean by it is that any application can put the iframe as part of their application and customize it. Where the source of the iframe is, is irrelevant, as it should be transparent to the app.
That’s not entirely correct. All you need to do is set the right headers to allow it. meet.jit.si, for example, allows any origin. You could configure your installation to only allow your main domain.
Hey @methodbox did you close this intentionally? AFAIK we haven’t fixed this yet.
Setting up two domains, subdomain or not complicates a lot of things. Take into account the fact that an app developed in a corporate environment needs to meet certain requirements.
Also take into account that two domains shouldn’t be technically necessary if your app was checking the for its files in the correct relative path (which is the reason I consider this a bug), and/or if the base URL was configurable.
Let’s Encrypt is not a long-term option for SSL in our business environment. For a number of reasons, we must use SSLs from a specific vendor as that is our requirement, this means they are paid SSLs.
As I mentioned, I’m a Sys Admin, and I have a lot of experience with Nginx so I’m aware of a number of security issues caused by improper or insecure configurations - this includes allowing something like cross-domain modification of iframes.
See this:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
Using “sameorigin” it will likely be possible to embed the iframe and also make calls and CSS modifications, but this requires the base domain to be the same; it can’t be from a different subdomain.
The setting you’re referring to is likely the “allow-from uri” which is deprecated and not supported in modern browsers, for good reason.
It seems like rather than admitting there is an actual problem, you’re trying to say my use case doesn’t matter.
It seems if the intention is to allow Jitsi to be embedded in an app and there is no requirement listed to run it on a separate domain, or configurable option to set the base URL, this intention and the actual functionality of Jitsi are at odds.
That’s either a bug or simply something you don’t want to support, but the solution isn’t just “fix your web server”.
Again, a great example of why you may want to open your own issues (literally everyone else who has posted that isn’t me or from Jitsi) because this isn’t getting watched by Jitsi and this is way outside the scope of the original issue.
This is getting a little off-topic: But in that case, of course, you have to publish your jitsi-web’s port 80 to port 8000 (at least you are trying to reach it there (i.e. you need a “-p 8000:80” parameter when starting the jitsi-web container or the corresponding in docker-compose.yml) and it looks like the nginx-proxy does not correctly remove the “jitsi” subpath from the url, before giving it to localhost:8000. I suspect that is what the prexy_redirect and proxy_set_header entries might be doing, but I’m not a 100% sure. For me it seems to work with the config I have shown you. Best of luck.
My nginx config looks just slightly more complex, but I can’t really explain what all the proxy_redirect and proxy_header lines are doing:
Hope that helps.
I understand that’s possible, but it’s the same problem. It means two SSLs instead of one, it means DNS settings and it means the app isn’t a URL within routing of my app but a completely separate domain.
Again, this isn’t something that should be an hard to configure - it’s extremely common.
If Jitsi truly can be embedded in my app, it should be just that, not living on a separate domain.
There’s also the issue of accessing things inside the iframe - if things are on the same domain this is easy, if they are not it’s not allowed.