vagrant-spk icon indicating copy to clipboard operation
vagrant-spk copied to clipboard

Document static files handling in `uwsgi` VM

Open paulproteus opened this issue 10 years ago • 3 comments

For a 0bin package, I need to at least do:

ln -s zerobin/static static

because static assets are configured (in our nginx conf) to come from /opt/app/static.

The 0bin deployment instructions suggest that I add a few other Iines to the nginx configuration, like this:

    location /static/ {
        root  /path/to/zerobin;
        gzip  on;
        gzip_http_version 1.0;
        gzip_vary on;
        gzip_comp_level 6;
        gzip_proxied any;
        gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
        gzip_buffers 16 8k;
        # Disable gzip for certain browsers.
        gzip_disable ~@~\MSIE [1-6].(?!.*SV1)~@~];
        expires modified +90d;
    }

(source: https://0bin.readthedocs.org/en/latest/en/nginx_install.html )

I think doing that is more trouble than it's worth. If I really did want to do that, though, I'd also suggest that the nginx site config live in .sandstorm/. I wonder what @zarvox would think of that, but luckily I'm not suggesting it yet.

I'm OK being the one to own this documentation issue, so I'll self-assign.

paulproteus avatar Jul 07 '15 01:07 paulproteus

Actually, I am +1 on the idea of just storing the nginx config snippet under .sandstorm. Given that the content is already canonically in that folder inlined in setup.sh, I don't see a problem with making that easier to edit. It kinda fits with the mentality of "the VM and Debian dependencies are like libraries your app is pulling in".

I guess the question then becomes "how much configfile do you want to maintain" because you could of course check in an entire nginx conf rather than a snippet/site, and not use any of the Debian-provided scaffolding. Then your packaging is very neatly isolated, but then you have to maintain a whole nginx conf rather than a snippet, which may be more challenging/less reusable/lead devs to cargo-cult config files. Food for thought.

zarvox avatar Jul 07 '15 06:07 zarvox

For now, I'm +1 on the idea of it just being the site config, and us seeing if anyone ever needs more, and hoping they don't.​

Nice to know that we have similar perspectives on this!

paulproteus avatar Jul 07 '15 06:07 paulproteus

Interestingly we have moved to store all service config files in .sandstorm/service-config/

Leaving this open b/c I think we write docs about .sandstorm/service-config

paulproteus avatar Feb 21 '16 23:02 paulproteus