mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	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:
		@@ -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;
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user