-
Notifications
You must be signed in to change notification settings - Fork 31
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
[BUG] does not work behind proxy #3
Comments
Thanks for reporting @MM-Lehmann ! I have to say that at least from the top of my head I really don't know how to fix this. Is there any way I could reproduce the problem? I have yet no experience on proxies. If you have any ideas on how to reproduce the problem or try to narrow it down / fix it, please share or throw me with a pull request. The first step would be to check if it is problem in the JS side or in Flask configuration. What kind of errors you get to the browser console? (F12) Do the XHR request look like going to the right address? (F12 -> Network tab). If you can explain a little more about how the proxy works (with a diagram?), maybe we can find where it goes wrong. |
The address issued by resumable.js is
|
I created an update (0.2.4) where user is able to configure the upload component API endpoint like this: du.configure_upload(
app,
UPLOAD_FOLDER_ROOT,
upload_api="/any/address/dash-upload",
) So, when running the dash app with app.run_server(debug=True, host='127.0.0.1', port=8877) the POST requests by the upload component are directed to
so you can change the path any way you want (after the host). If I understood right, now you would like to use du.configure_upload(
app,
UPLOAD_FOLDER_ROOT,
upload_api="/app/api/dash-upload",
) Does this help you? |
Wow, thanks for the instant reply and action! Your support is impressive.
This is indeed a different message than before, so requests seem to go a bit farther than before but somehow get rejected by the server (host or waitress/flask?!). EDIT: The above is with waitress under linux. When running the flask dev server, the error becomes |
I'm happy to help! The code worked on my local machine, so I guess there is something with your server configuration what we are missing here. The place where the configuration happens is in configure_upload.py, in the @server.route(upload_api, methods=['POST']) The Perhaps next you could try to define any new route to your flask application that can handle |
After much debugging, I've found a solution/workaround. The problem was indeed somehow connected to my apache reverse proxy config (which I cannot administer). In order to make the app load at all, I have to set This way, I think resumable.js gets confused because it expects a unified I hope this is somewhat comprehensible. Thank you for your sublime support! |
Okay I think I got a grasp on what was happening there. So, to recap, you run the app at
and therefore initiate the dash app instance with app = dash.Dash(
__name__,
requests_pathname_prefix='myproxy',
) To make the @server.route('/api/dash-uploader', methods=['POST']) and in the front-end, POST the requests to I think that the Upload component should work out of the box with proxies, too. Thank you for the detailed info. Your proposed fix seems to be very accurate. However, since all the necessary information is already in the I made a suggested solution to another branch: https://github.com/np-8/dash-uploader/tree/issue3 Unfortunately, I do not have a proxy set up, so the dash app won't even start when using any
and verify that it works in your proxy setup out of the box? |
Runs perfectly out of the box. I don't even to define the |
I added the fix in 0.3.0. Thank you for your help! |
I am running dash on a server which sits behind a reverse proxy. Thus, the flask server does not get the real client IP but the proxy IP instead.
Upload would let me select files and display the progress bar but is stuck at 0% and never progresses or actually send data.
Maybe this is a bug of resumable.js? -> 23/resumable.js#214
The text was updated successfully, but these errors were encountered: