I\'m trying to serve Django static media through nginx, Here\'s my nginx.conf
server {
listen 7777;
listen localhost:7777;
server_name e
502 bad gateway
is because apache has a problem (not restarted or something like that). You can check the apache server logs for info.
The problem is your /sites/mysite/staticmedia/
is being passed to apache and not served by nginx itself.
Your nginx media part has to be like this:
location /staticmedia/ {
root /sites/mysite/;
expires max;
autoindex on
}
This will access /sites/mysite/staticmedia/
on the filesystem.
That is, the path of location specified with location is a considered to be the part of the file system too. (I don't think this is good way either; but this is how nginx does it.)
You can leave the autoindex on, to help you during debug.