-
Notifications
You must be signed in to change notification settings - Fork 45
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
Configuration with reverse proxy in custom path not possible #403
Comments
Hey @AlexVilchis, apologies for the delay, and thanks for the investigation! You're right that the WS URL is not configurable. Rather than an environment variable, how about I add a configuration option to Studio's server? Then I can expose it via a CLI parameter to the I'm thinking of maybe reusing this config option for some other things, so Side note: I should also probably replace my rather naive approach of replacing |
I don't know about |
Could the initial problem be that the mentioned I had the sameish problem that the Websocket couldn't complete the handshakes, when requested through a nginx reverse proxy thingamajig. |
What's the status of this problem?I'm running into same problem. |
Hey @keidarcy and others, Studio no longer uses a Websocket connection to talk to the backend, it instead uses regular HTTP POST calls. |
@madebysid I should be able to try it out on a https server that has prisma-studio run through a nginx proxy. |
Oh, no, since it is bundled with the If you really want though, you can use Studio's server directly (NPM package |
Unfortunately our setup has the same issue with the relative
Can't get both to run as just @madebysid Is there any way to configure which relative path prisma studio will use? Some environment variables or anything? |
For me this problem also still exists, I'm running prisma studio and the backend in separate docker containers and it tries to resolve the relative |
I'm running on the same issue. |
So prisma studio has no base url variable right? |
Same issue here. Any updates on this? |
I would love to be able to do this for my SQLite database. I don't have any nice way to inspect my data running on a remote server so I'd love to have an authenticated proxy for prisma studio. |
I've got this working with a few simple changes. I'm hosting my prisma studio proxied behind
And that was enough of the changes in prisma's code to make it proxyable. I'm not sure why that first thing had to happen because I believe |
@kentcdodds - for a toy app I made (https://github.com/andrewbrey/wael) that is also Note in particular the use of the html |
Still an issue. But I finally got it to work by: # prisma studio
# Configuration with reverse proxy in custom path not possible #403
# https://github.com/prisma/studio/issues/403
location = /data {
rewrite ^(.*[^/])$ $1/ redirect;
}
location /data {
rewrite /data/(.*) /$1 break;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:5555;
auth_basic "Restricted Content";
auth_basic_user_file /.../.htpasswd;
}
location = /api {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:5555;
auth_basic "Restricted Content";
auth_basic_user_file /.../.htpasswd;
} Thanks to that prisma-studio using exact |
is there some update from the prisma team to have that? |
Just confirming this still works in 2024 (although it seems there is no index.html anymore). |
Hi there. You may have seen my message on Slack. I am trying to configure Nginx to run Prisma Studio in a proxy server with custom location. For example, in
myapp.com/_studio
. I managed to get the relevant config working for the HTML, JS, favicon, CSS. However, the ws connection string is still not resolved properly.I believe the problem is in this line of serverBus.js:
![Screen Shot 2020-04-10 at 9 50 06](https://user-images.githubusercontent.com/29064411/78999637-ab308b80-7b10-11ea-9713-eb44d8dbada3.png)
It uses window.location.host to construct the ws connection URL, but it is not taking into account the pathname that the initial request has (_studio):
![Screen Shot 2020-04-10 at 9 54 04](https://user-images.githubusercontent.com/29064411/78999906-3873e000-7b11-11ea-838f-a82276875983.png)
Is there any way I can change the ws connection string myself? Any way to force it? Given that I am not in control of the Studio application, I cannot try much. Maybe it would be nice to pass an environment variable to control this behaviour. I'd suggest
STUDIO_WS_HOST_CONCAT_PATHNAME
or something like that.Nginix configuration
I am leaving this if it is relevant to anyone.
Environment
Prisma version (
prisma2 -v
):prisma 2.0.0-beta.2
Logs from Developer Tools Console, if any:
Any solution or guidance would be appreciated 👍
The text was updated successfully, but these errors were encountered: