tomdesair / tus-java-server

Library to receive tus v1.0.0 file uploads in a Java server environment
MIT License
131 stars 62 forks source link

Reverse proxy #24

Closed zeus19900814 closed 5 years ago

zeus19900814 commented 5 years ago

Does this work with Nginx reverse proxy? How do I set it up?

John

ksvraja commented 5 years ago

This does work with Nginx reverse proxy. You can setup as standard nginx reverse proxy configuration.

Just make sure the client_max_body_size is set to the maximum file size you are expecting

tomdesair commented 5 years ago

An alternative approach is to set proxy_request_buffering to off so that the upload is immediately streamed to the Tus server and not first buffered in memory by NGINX.

In your server block add a location directive specific to your upload endpoint like this:

        location /api/upload {
            proxy_read_timeout 3600s;
            proxy_request_buffering off;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://127.0.0.1:8080;
        }

Does this solve your problem?

zeus19900814 commented 5 years ago

Yes! This works! Thanks!