0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-24 19:17:48 +01:00
wagtail/etc/nginx.conf.sample

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.3 KiB
Plaintext
Raw Normal View History

# vim:sw=4 ts=4 et:
#
# This is a sample nginx configuration for a Wagtail application running under
# uWSGI.
server {
# We don't set 'root' here, because we send location / to uWSGI, so
# nothing ends up at nginx's default handler.
listen 80;
server_name mywagtail.org;
error_log /var/log/nginx/mywagtail.org_error.log;
access_log /var/log/nginx/mywagtail.org_access.log;
# Maximum file upload size.
client_max_body_size 64M;
# Enable content compression for text types.
gzip on;
gzip_types text/plain text/css application/x-javascript image/svg+xml;
gzip_comp_level 1;
gzip_disable msie6;
gzip_http_version 1.0;
gzip_proxied any;
gzip_vary on;
location /static/ {
access_log off;
expires 3600;
alias /home/mywagtail/app/static/;
}
# Set a longer expiry for CACHE/, because the filenames are unique.
location /static/CACHE/ {
access_log off;
expires 864000;
2018-12-30 20:49:13 +01:00
alias /home/mywagtail/app/static/CACHE/;
}
2018-12-30 20:54:16 +01:00
# Only serve /media/images/ by default, not e.g. original_images/.
location /media/images/ {
expires 864000;
2018-12-30 20:54:16 +01:00
alias /home/mywagtail/app/media/images/;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/home/mywagtail/mywagtail.sock;
break;
}
}