A partial archive of meta.discourse.org as of Tuesday July 18, 2017.

Disable serve static files

leo.proctor

Somehow i want to disable public access to assets. In development by config.serve_static_files = false, it serves the purpose. It routes requests to upload controller, where i can authenticate or deny access. While in production it doesn’t seem to be working. In my app.yml file

DISCOURSE_SERVE_STATIC_ASSETS: false

Falco

On production assets are served by nginx:

    location ~ ^/assets/(?<asset_path>.+)$ {
      expires 1y;
      brotli_static on;
      gzip_static on;
      add_header Cache-Control public,immutable;
    }

leo.proctor

Ahan, Can I somehow change ngnix configuration from outside container? may be in app.yml?

mpalmer

Yes, you’ll need to write a custom pups config statement to remove the config from the nginx config file.