Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nginx invalid number of arguments in "proxy_pass" directive

Tags:

nginx

django

nginx: [emerg] invalid number of arguments in "proxy_pass" directive in /etc/nginx/sites-enabled/django_direct:12

My nginx conf file:

server {
    listen 80;
    server_name 94.154.13.214;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /root/django_direct/main_app/;
    }

    location / {
        include proxy_params;
        proxy_pass unix: /root/django_direct/django_direct.sock;
    }
}

What do I do? UPD: I have changed file like this:

proxy_pass http://unix:/root/django_direct/django_direct.sock;

But didn't help, I've restarted nginx and now I am getting now a 502 Bad Gateway error.

like image 413
user2950593 Avatar asked Jul 29 '18 22:07

user2950593


1 Answers

If someone else finds this and has this error. Check that you have a semi-colon at the end of the parameters line. goes for all of the lines, not just proxy_pass.

like image 68
jogi Avatar answered Jan 08 '23 01:01

jogi