1

I am using linux fedora, i installed nginx as sudo yum install nginx.I have created a django project and assigned a port as guicorn projectname.wsgi:application --bind=127.0.0.1:8001.And i created a file in /etc/nginx/sites-enabled/default

in my default file i have the following code:

server {
   listen localhost:8006;

   location / {
   proxy_pass http://127.0.0.1:8001;
   }

   location /static/ {
   autoindex on;
   alias /home/user/Desktop/projects/28-05-2014/HMS/static/;
}
}

When i checked my nginx server home as localhost:80 it is running.But when i called localhost:8006 it is not connecting. When i checked active connections with netstat -lnt | grep 80 i found only nginx default service is running.What mistake i am doing.Any help would be appriciated

Mulagala
  • 8,231
  • 11
  • 29
  • 48

2 Answers2

1

Not enough information to answer.

Enable logging:

access_log /var/log/nginx/example.access.log;
error_log /var/log/nginx/example.error.log;

And look at what the log files says. If you cannot figure it out, please post the log outputs here. Question does not provide enough data. I ll update this answer as you update your question.

dhilipsiva
  • 3,688
  • 1
  • 24
  • 35
  • modified file restarted the server and given request but nothing happen.Even the files also not created.First server is not listing any request to write log files – Mulagala May 29 '14 at 06:15
  • Looks like you have permission issues. follow this: http://stackoverflow.com/questions/18714902/nginx-on-ubuntu-permission-denied – dhilipsiva May 29 '14 at 07:07
1

Place the above code in nginx.conf file which is located in /etc/nginx/.Then your configuration file looks like this

nginx.conf

server {
   listen localhost:8006;

   location / {
   proxy_pass http://127.0.0.1:8001;
   }

   location /static/ {
   autoindex on;
   alias /home/user/Desktop/projects/28-05-2014/HMS/static/;
}
}
Shiva
  • 988
  • 4
  • 15
  • 31