We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The serving of static assets in the production deployment is not working.
The call to anything in /static/ returns a 404 Nginx Error.
The text was updated successfully, but these errors were encountered:
I have done the usual python manage.py collectstatic --no-input command on run.
python manage.py collectstatic --no-input
Tried:
$ docker-compose -f production.yml run nginx ls /usr/src/app/static
docker-compose -f production.yml run nginx ls /usr/src/app/static
Output:
$ ls: cannot access /usr/src/app/static: No such file or directory
ls: cannot access /usr/src/app/static: No such file or directory
Sorry, something went wrong.
$ docker-compose -f production.yml run nginx ls /www/static
docker-compose -f production.yml run nginx ls /www/static
Returns:
$ admin
admin
The fix was to change the location alias to point to the same as in the production.yml file, i.e., /www/static.
Change sites-enabled/django-project to:
server { listen 80; server_name example.org; charset utf-8; location /static { alias /www/static; } location / { proxy_pass http://web: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; } }
No branches or pull requests
The serving of static assets in the production deployment is not working.
The call to anything in /static/ returns a 404 Nginx Error.
The text was updated successfully, but these errors were encountered: