BytemarkHosting / docker-webdav

Docker image for running an Apache WebDAV server
MIT License
350 stars 166 forks source link

Using Nginx #31

Open NMO13 opened 3 years ago

NMO13 commented 3 years ago

I want to use this container behind an Nginx server but I am not able to configure Nginx properly.

I have the following server block in Nginx:

      server {
            server_name mydomain.com;

            location /calendar {
            #   proxy_set_header   Host  -; # maybe set host header somehow?
               proxy_pass http://127.0.0.1:90/;
            }

    listen 443 ssl; # managed by Certbot
    ssl_certificate ...
    ssl_certificate_key ...
    include ...
    ssl_dhparam ...

}

and I adapted the docker-compose.yml file in the following way:

version: '3'
services:
  webdav:
    image: bytemark/webdav
    restart: always
    ports:
      - "127.0.0.1:90:80"
    environment:
      AUTH_TYPE: Digest
      USERNAME: alice
      PASSWORD: secret1234
    volumes:
      - data:/var/lib/dav
volumes:
  data:

When I make a request to https://mydomain.com/calendar I always get following error:

webdav_1 | [Thu Jul 08 18:53:16.605133 2021] [auth_digest:error] [pid 38:tid 139699229092584] [client 192.168.176.1:38338] AH01786: uri mismatch - </calendar> does not match request-uri </>, referer: http://mydomain.com/calendar I suppose it has something to do with the host header bc. Apache seems to get the uri /calendar from it.

jcormier commented 2 years ago

Should be able to set LOCATION to /calendar to match proxy location.