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

53 lines
1.3 KiB
Plaintext

# 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;
alias /home/mywagtail/static/CACHE/;
}
# Only server /media/images by default, not e.g. original_images/.
location /media/images {
expires 864000;
alias /home/mywagtail/app/media/;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/home/mywagtail/mywagtail.sock;
break;
}
}