snapdrop icon indicating copy to clipboard operation
snapdrop copied to clipboard

snapdrop instance behind Apache Proxy: How to implement X-Forwarded-For

Open Tone866 opened this issue 2 years ago • 1 comments

I'm trying to run snapdrop behind a apache reverse proxy. Everything works, except that I can see every hosts instead only that one in my network. I don't know how I can implement the X-Forwarded-For part with apache. I googled a bit but nothing works. Can anyone help?

This is my current config:

RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /snapdrop/(.*) ws://localhost:8080/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /snapdrop/(.*) http://localhost:8080/$1 [P,L]

ProxyPass               /snapdrop/     http://localhost:8080/
ProxyPassReverse        /snapdrop/     http://localhost:8080/
ProxyPass               /snapdrop/     ws://localhost:8080/

<Proxy https://localhost:8080/>
    AllowOverride None
    Order allow,deny
    Allow from all
</Proxy>

Tone866 avatar Oct 15 '22 16:10 Tone866

The issue is related to the linuxserver/docker-snapdrop's default nginx config, which will resolve all clients' IP to the IP address of reverse proxy , check this: https://github.com/linuxserver/docker-snapdrop/pull/4/commits/d07b0fcb01ceed78ccdeabb1e746c2d0304839ec#diff-b798d7ad17e8cc7e11749264de70d9201e8767881b0df5980369a5e2edc6f804

mwy001 avatar Nov 03 '22 04:11 mwy001