1

My nginx configuration file is given below.

server {
  listen 80;
  server_name http://hg.rawdatatech.com;

  location / {
    proxy_pass http://127.0.0.1:8000;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

  location /static/ {
    alias /home/home-garden/staticfiles/;
  }
}

When I run my Django application using this configuration I saw "suspicious symbol error" and connection refusing error nginx error log. Is there any wrong in my configuration?

3
  • 1
    First, your server_name is wrong. It should be plain domain name. Second, does your Django application even started?
    – Alexey Ten
    Jul 2, 2015 at 7:52
  • Please do not paraphrase error messages quote them verbatim.
    – AD7six
    Jul 5, 2015 at 6:09
  • This helped me: serverfault.com/questions/447871/…
    – Ryan
    Apr 26, 2019 at 11:36

1 Answer 1

2

Remove http:// from server_name config

New config will be something like this

server {
  listen 80;
  server_name hg.rawdatatech.com;

location / {
  proxy_pass http://127.0.0.1:8000;
  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} 

location /static/ {
  alias /home/home-garden/staticfiles/;
}
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.