question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not MOVE or COPY file with HTTPS reverse proxy

See original GitHub issue

I can not move, rename, copy any file. the route is : client ==HTTPS=> nginx reserve proxy ==HTTP=>wsgidav (cheroot)

However, when I skip https reserve proxy client ==HTTP/HTTPS=>wsgidav (cheroot) everything is OK

Finally I found the problem.

When I use https reserve proxy, the environ[“HTTP_DESTINATION”] is “https://abc.com/file” and the scheme is https

However the environ[“wsgi.url_scheme”] is http , just because nginx access wsgidav using http

In this line of code #L942

        if destScheme and destScheme.lower() != environ["wsgi.url_scheme"].lower():
            self._fail(
                HTTP_BAD_GATEWAY, "Source and destination must have the same scheme."
            )

it will check destination scheme and wsgi_url scheme and there is no doubt that it will fail.

I just simplify delete this line code and everying be OK.

So,this line code should be deleted ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mdemosscommented, Jun 28, 2020

I configured my nginx reverse proxy like this and it works:

        location /drive/ { # wsgidav
                proxy_pass http://localhost:8922;
                proxy_http_version 1.1;
                proxy_set_header HOST $host;
                #proxy_set_header Connection "upgrade";
                proxy_set_header X-NginX-Proxy true;
                proxy_buffering off;
                client_max_body_size 0;
                proxy_request_buffering off;
                set $dest $http_destination;
                if ($http_destination ~ "^https://mycooldomain.example.com/drive/(.+)") {
                        set $dest /drive/$1;
                }
                proxy_set_header DESTINATION $dest;
        }
1reaction
mar10commented, Oct 18, 2020

Thanks @Lobstros !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Can not MOVE or COPY file with HTTPS reverse proxy -
I can not move, rename, copy any file. the route is : client ==HTTPS=> nginx reserve proxy ==HTTP=>wsgidav (cheroot). However, when I skip...
Read more >
Web Client File Upload Fails Outside of Internal Network due ...
I've been using the reverse proxy for several years and works fine. I have it setup to forward https requests for the Cerberus...
Read more >
Can not upload big files with Nginx (Reverse proxy+SSL ...
I had the same problem. The answer of Michael Härtl is correct. In my case this was the setup that did the trick:...
Read more >
IIS acting as reverse proxy: Where the problems start
Go to the Inbound Rules section in URL Rewrite. This section should just contain one inbound rule, called 'Reverse Proxy Inbound Rule 1'....
Read more >
How To Set Up a Reverse Proxy (Step-By-Step for Nginx ...
A reverse proxy like HAProxy can add basic HTTP access authentication to a web server that doesn't have it enabled. You can also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found