Skip to content

Speed up serving static files by serving them through ngnix and not application #10

Description

@michaelwood

Serving the files via gunicorn is much slower than directly from the web server/ngnix

We optimised this in insights-ng. See example in insights-ng:

insights salt file:

dokku storage:ensure-directory insights_static
dokku storage:mount insights-ng /var/lib/dokku/data/storage/insights_static:/insights_static
insights_ngnix_static_conf:
  file.managed:
    - name: /home/dokku/insights/nginx.conf.d/static.conf
    - source: salt://nginx/insights_static.conf
    - require:
      - cmd: insights_create_app

static.conf:

location /static/ {
  alias /var/lib/dokku/data/storage/insights_static/;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions