Updated Using a Reverse Proxy with Paperless ngx (markdown)

RichBrew 2025-06-23 20:09:26 -04:00
parent 5d32b1f08a
commit eabde26154

@ -1,5 +1,4 @@
[Nginx](#nginx) | [Apache](#apache) | [Caddy](#caddy) | [Traefik](#traefik) | [SWAG](#SWAG) [Nginx](#nginx) | [Apache](#apache) | [Caddy](#caddy) | [Traefik](#traefik)
If you want to expose paperless to the internet, you should hide it 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. behind a reverse proxy with SSL enabled. The officially supported method is Nginx.
@ -231,37 +230,3 @@ Below is an example Traefik configuration you would add to the webserver contain
- "traefik.http.routers.paperless.tls.certresolver=letsencrypt" - "traefik.http.routers.paperless.tls.certresolver=letsencrypt"
- "traefik.http.services.paperless.loadbalancer.server.port=8000" - "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";
```