From 2ffec7cfcebb0d9c183a5f26aa20717ad53446b2 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 18 May 2023 08:47:38 -0700 Subject: [PATCH] Created Using a reverse proxy with Paperless-ngx (markdown) --- Using-a-reverse-proxy-with-Paperless-ngx.md | 44 +++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Using-a-reverse-proxy-with-Paperless-ngx.md diff --git a/Using-a-reverse-proxy-with-Paperless-ngx.md b/Using-a-reverse-proxy-with-Paperless-ngx.md new file mode 100644 index 0000000..21c744e --- /dev/null +++ b/Using-a-reverse-proxy-with-Paperless-ngx.md @@ -0,0 +1,44 @@ +# Nginx + +If you want to expose paperless to the internet, you should hide it +behind a reverse proxy with SSL enabled. + +In addition to the usual configuration for SSL, the following +configuration is required for paperless to operate: + +```nginx +http { + + # Adjust as required. This is the maximum size for file uploads. + # The default value 1M might be a little too small. + client_max_body_size 10M; + + server { + + location / { + + # Adjust host and port as required. + proxy_pass http://localhost:8000/; + + # These configuration options are required for WebSockets to work. + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $server_name; + add_header P3P 'CP=""'; # may not be required in all setups + } + } +} +``` + +The `PAPERLESS_URL` configuration variable is also required when using a +reverse proxy. Please refer to the [hosting and security](/configuration#hosting-and-security) docs. + +Also read +[this](https://channels.readthedocs.io/en/stable/deploying.html#nginx-supervisor-ubuntu), +towards the end of the section.