-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Nginx configuration and Dockerfile updates for static file handling
The commit includes a new Nginx configuration file to effectively manage static and media files. Dockerfile is updated to create and set the right permissions for media and static directories, and to collect static files. Also, Dockerfile is now set up to use the new Nginx configuration for better consistency and easier deployment.
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
location /static/ { | ||
alias /usr/src/app/staticfiles/; | ||
} | ||
|
||
location /media/ { | ||
alias /usr/src/app/mediafiles/; | ||
} | ||
|
||
location / { | ||
proxy_pass http://127.0.0.1:8000; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} |