-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
File endpoints: use query parameters for NGINX/Caddy compatibility #6376
base: master
Are you sure you want to change the base?
File endpoints: use query parameters for NGINX/Caddy compatibility #6376
Conversation
If necessary, I can theoretically write a test for this, but I'm not sure that the design of endpoint should be covered by tests. I can describe in more detail why these changes are needed, but in the linked issues that were not created by me, everything seems clear. |
This PR might be easier to merge if you supported both types of endpoint, so that people who have an older or alternative frontend don't just break since the frontend can be installed separately from the backend and isn't guaranteed to be in sync. For nginx specifically, it seems it urlencodes the path if your proxy_pass directive contains a url path component. So
works properly, but
or anything specifying a subpath does not |
7e1ae9b
to
720b03e
Compare
Thank you very much for the correct and accurate remark, - re-pushed the commit. After your remark:
Is there anything else that is missing? |
May I ask about the approximate date when this or a similar PR that corrects this situation might be merged? |
+1 for solving this problem, would be nice to be able to run caddy in front of Comfy (to get HTTPS). |
+1 to this, using Traefik for HTTPS |
@comfyanonymous hello. sorry to bother you, but can you ask @huchenlei or @robinjhuang to take a look at this PR/problem when they have some free time. Thanks in advance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in a position to review this properly right now, but here are some quick suggestions to make it easier to review / test the PR.
720b03e
to
0895b86
Compare
…parameters for proxy compatibility Signed-off-by: bigcat88 <[email protected]>
0895b86
to
0c2067a
Compare
|
For this PR to work, you need to switch to it, and also rebuild the frontend (which is in another repository) with the linked PR. Or just wait until someone from the Comfy organization finds time to review this PR for merge. |
PR Description
When deploying ComfyUI behind
NGINX
, we encountered issues with file-related endpoints due to the use of path parameters for file paths. Proxy servers may modify the encoding of URLs, leading to inconsistent behavior. For example:http://127.0.0.1:8188/api/userdata/workflows%2Fphoto_stickers2.json?overwrite=false&full_info=true
NGINX
may decode it to:http://127.0.0.1:8188/api/userdata/workflows/photo_stickers2.json?overwrite=false&full_info=true
This inconsistency caused the ComfyUI server to respond with a
405 Method Not Allowed
status.Changes Made:
getuserdata
,post_userdata
,delete_userdata
, andmove_userdata
) to use query parameters instead of path parameters for file paths. This ensures compatibility with proxy servers by avoiding reliance on URL path encoding.move_userdata
endpoint, both the source and destination paths are now passed as query parameters (source
anddest
).Notes:
This PR replaces old PR #6363 which was only a workaround which we applied on server to temporary make ComfyUI work.
Resolves: #5629
Partially fixes problem from #4534