nginx: Use the Django 404 page for files under static/.

This elimintes the need for us to maintain duplicate copies of the
Zulip 404 error pages.

Fixes #5382.
This commit is contained in:
Tim Abbott
2017-07-16 16:34:05 -07:00
parent a05de7ce84
commit 2317819e47
5 changed files with 10 additions and 38 deletions

View File

@@ -33,10 +33,15 @@ likely culprit.
Static files include JavaScript, css, static assets (like emoji, avatars),
and user uploads (if stored locally and not on S3).
File not found errors (404) are served using a Django URL, so that we
can use configuration variables (like whether the user is logged in)
in the 404 error page.
```
location /static/ {
alias /home/zulip/prod-static/;
error_page 404 /static/html/404.html;
# Set a nonexistent path, so we just serve the nice Django 404 page.
error_page 404 /django_static_404.html;
}
```