Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Problem pulling static content with reverse proxy #697

Open
AlexKalopsia opened this issue Aug 17, 2020 · 0 comments
Open

Problem pulling static content with reverse proxy #697

AlexKalopsia opened this issue Aug 17, 2020 · 0 comments

Comments

@AlexKalopsia
Copy link

I am running Paperless on my server and I am trying to setup remote access (https://paperless.mydomain.com) to it via reverse proxy. I get it to work, but Paperless fails to load the static files (ie all CSS).

I've bashed into the container and used ./manage.py collectstatic. I confirm I can see all the static files on my paperless/static mounted folder.

Docker-compose

version: "3"
services:

  paperless-webserver:
    container_name: paperless-webserver
    image: thepaperlessproject/paperless:latest
    ports:
      - "4444:8000"
    env_file:
      - /volume1/docker/.env
    environment:
      - PAPERLESS_OCR_LANGUAGES=eng ita swe nld bul
      - PAPERLESS_PASSPHRASE=${PAPER_PSW}
      - PAPERLESS_USE_SSL=true
      - USERMAP_UID=1000
      - USERMAP_GID=1000
      - TZ=${TZ}
    volumes:
      - /volume1/docker/paperless/data:/usr/src/paperless/data
      - /volume1/docker/paperless/media:/usr/src/paperless/media
      - /volume1/docker/paperless/consume:/consume
      - /volume1/docker/paperless/export:/export
      - /volume1/docker/paperless/static:/usr/src/paperless/static
    command: ["runserver", "--insecure", "--noreload", "0.0.0.0:8000"]
    restart: unless-stopped

  paperless-consumer:
    container_name: paperless-consumer
    image: thepaperlessproject/paperless:latest
    environment:
      - PAPERLESS_OCR_LANGUAGES=eng ita swe nld bul
      - PAPERLESS_PASSPHRASE=${PAPER_PSW}
      - PAPERLESS_USE_SSL=true
      - USERMAP_UID=1000
      - USERMAP_GID=1000
      - TZ=${TZ}
    tmpfs:
      - /tmp
    depends_on:
      - paperless-webserver
    volumes:
      - /volume1/docker/paperless/data:/usr/src/paperless/data
      - /volume1/docker/paperless/media:/usr/src/paperless/media
      - /volume1/docker/paperless/consume:/consume
      - /volume1/docker/paperless/export:/export
    command: ["document_consumer"]
    restart: unless-stopped

nginx:

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name papers.*;

    include /config/nginx/ssl.conf;

    index index.html index.htm index.php;
    access_log /config/log/nginx/paperless_access.log;
    error_log /config/log/nginx/paperless_error.log;

    location /static {
        autoindex on;
        alias /volume1/docker/paperless/static;
    }

    location / {
        include /config/nginx/proxy.conf;
        proxy_pass http://192.168.1.200:4444;
    }
}

I can't understand why all the static files return 404. File permissions seem ok. Any idea?

Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant