nginx serving Django static media | 502 bad gateway

后端 未结 5 1349
暗喜
暗喜 2021-02-11 09:14

I\'m trying to serve Django static media through nginx, Here\'s my nginx.conf

server {
    listen       7777;
    listen       localhost:7777;
    server_name  e         


        
5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-11 09:59

    server {
        listen       7777;
        listen       localhost:7777;
        server_name  example.com;
    
        location / {
            proxy_pass http://localhost:7777;
    ...
    

    nginx listening on port 7777 and connecting to a proxy located at port 7777 on same host. No wonder it returns 502 error.

提交回复
热议问题