Hello, here is the conf file itself

 server { listen 80; server_name #ip скрыл в целях безопасности; location /static/ { root /home/firstuser/firstproject; } location /media/ { root /home/firstuser/firstproject; } location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://unix:/home/firstuser/firstproject/firstproject/firstproject.socket; } } 

When you type in console, $ sudo service firstproject restart

>>> firstproject: unrecognized service

I use Ubuntu 12.04.5 LTS

The file is in the path /etc/nginx/conf.d with the name firstproject.conf

  • Duc restart nginx - you changed its config, but did not create a new unit systemd ... maybe enough reload'a. - Fat-Zer
  • @ Fat-Zer I rebooted the system, did not help ( - Milkiweed Gtlt
  • how to configure nginx I will not answer ... just posing the problem is absolutely awkward ... - Fat-Zer
  • Correcting itself, of course, not a systemd unit, but an init script ... - Fat-Zer

1 answer 1

The fact that the systemd or upstart unit is not written here is not at all like an init file.

Here is an example of the nginx config. In this config a proxy on a socket. This socket must be opened by your project. But how to run your project depends on the framework and programming language. Show the structure of the project - I will tell you how to make the correct init.