timvisee / send

:mailbox_with_mail: Simple, private file sharing. Mirror of https://gitlab.com/timvisee/send
https://send.vis.ee
Mozilla Public License 2.0
4.75k stars 271 forks source link

Nginx subdomain proxy configuration #96

Open andrewlow opened 2 years ago

andrewlow commented 2 years ago

Leaving this here for anyone who's trying to get this working behind an nginx reverse proxy.

I've used a plain docker container setup

I did get a very strong hint on the setup from a previous issue https://github.com/timvisee/send/issues/14 This doc for nginx also helped me understand the situation https://www.nginx.com/blog/websocket-nginx/

Here is my send.subdomain.conf file that drops nicely into the swag configuration (shout out to the linuxserver.io folks)


## 
# Send
#

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name send.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth, fill in ldap details in ldap.conf
    #include /config/nginx/ldap.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;

        # set headers to support websocket
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";

        set $upstream_app send;
        set $upstream_port 1443;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }
}

I suggest we just close this issue immediately - but if there was a logical place to add this to the documentation then I can create a PR with those changes.

Thanks for the work on this project.

timvisee commented 2 years ago

Please see this repository for a Docker configuration that has this configured: https://github.com/timvisee/send-docker-compose

Does that help?

andrewlow commented 2 years ago

@timvisee thanks for being responsive on issues. This is a great project.

No. The docker-compose setup didn't seem to (obviously) solve the problem. The nginx setup seem to pointing a the docker image jwilder/nginx-proxy:alpine which does all of the nginx stuff from what I can see. The key part is that beyond a normal 'proxy' setup - you have to also configure nginx to properly manage the websocket forwarding/proxying.

The point of my issue here was to capture what works for me - using the LinuxServer.io SWAG image.

I suggest that we close this issue - I have no problem, and others may find this that are trying to combine SWAG + Send - or are simply looking for a few more hints on nginx proxy configuration.

0xspade commented 2 years ago

cries in apache