From 5d32b1f08a07cfd1808ca62e6383debd0bf3df5e Mon Sep 17 00:00:00 2001 From: RichBrew Date: Mon, 23 Jun 2025 20:07:09 -0400 Subject: [PATCH] Add SWAG configuration --- Using-a-Reverse-Proxy-with-Paperless-ngx.md | 36 ++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Using-a-Reverse-Proxy-with-Paperless-ngx.md b/Using-a-Reverse-Proxy-with-Paperless-ngx.md index cc0671f..0741fc3 100644 --- a/Using-a-Reverse-Proxy-with-Paperless-ngx.md +++ b/Using-a-Reverse-Proxy-with-Paperless-ngx.md @@ -1,4 +1,4 @@ -[Nginx](#nginx) | [Apache](#apache) | [Caddy](#caddy) | [Traefik](#traefik) +[Nginx](#nginx) | [Apache](#apache) | [Caddy](#caddy) | [Traefik](#traefik) | [SWAG](#SWAG) If you want to expose paperless to the internet, you should hide it behind a reverse proxy with SSL enabled. The officially supported method is Nginx. @@ -230,4 +230,38 @@ Below is an example Traefik configuration you would add to the webserver contain - "traefik.http.routers.paperless.tls=true" - "traefik.http.routers.paperless.tls.certresolver=letsencrypt" - "traefik.http.services.paperless.loadbalancer.server.port=8000" +``` + +# SWAG + +Below is an example of one way to configure SWAG for paperless-ngx + +Add the Auto-Proxy dockermod to the SWAG container. +This mod needs the universal-docker mod installed and set up with either mapping docker.sock or setting the environment variable DOCKER_HOST=remoteaddress. + +To add the dockermod with read only mapping to docker.sock, add the folling to the compose for the SWAG container: + +``` +environment: +- DOCKER_MODS=linuxserver/mods:universal-docker|linuxserver/mods:swag-auto-proxy + +volumes: +- '/var/run/docker.sock:/var/run/docker.sock:ro' +``` +Full documentation for Auto-Proxy here: +https://github.com/linuxserver/docker-mods/tree/swag-auto-proxy + + +Below is an example SWAG configuration you would add to the webserver container. + +Change the swag_url to match your own. + +``` +labels: +- swag=enable +- swag_url=paperless.mydomain.com +- swag_server_custom_directive=proxy_redirect off; +- swag_server_custom_directive=proxy_set_header Host $host:$server_port; +- swag_server_custom_directive=proxy_set_header X-Forwarded-Host $server_name; +- swag_server_custom_directive=add_header Referrer-Policy "strict-origin-when-cross-origin"; ``` \ No newline at end of file