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?

Alexey Ten
  • 7,922
  • 31
  • 35
Navajyoth M S
  • 123
  • 3
  • 7
  • 1
    First, your `server_name` is wrong. It should be plain domain name. Second, does your Django application even started? – Alexey Ten Jul 02 '15 at 07:52
  • Please do not paraphrase error messages quote them verbatim. – AD7six Jul 05 '15 at 06:09
  • This helped me: https://serverfault.com/questions/447871/suspicious-symbols-on-nginx-config#comment1255249_447873 – Ryan Apr 26 '19 at 11:36

1 Answers1

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/;
}
}
Abhijeet Kasurde
  • 985
  • 9
  • 20