nginx specify the configuration file

Close nginx

service nginx stop

Set up a profile order.conf

server {
        listen 80 default_server;
        listen 443 default_server;
        server_name www.xxx.cn;


        location /static {
                alias  /home/ubuntu/data/www/food_order/web/static/;
        }

        location / {
                try_files $uri @yourapplication;
        }
      location @yourapplication {
      include uwsgi_params;
      uwsgi_pass unix:/home/ubuntu/data/www/logs/order.sock;
      uwsgi_read_timeout 1800;
      uwsgi_send_timeout 300;
    }
}

The configuration file contains

Modify / etc / Nginx under nginx.conf 

    #include /etc/nginx/conf.d / * .conf;
     the include /etc/nginx/order.conf;

Restart nginx

service nginx start|restart

View Status

[root@VM_0_14_centos nginx]# systemctl status nginx
● nginx.service - nginx - high performance web server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-03-26 02:09:28 CST; 17min ago
     Docs: http://nginx.org/en/docs/
  Process: 7516 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
 Main PID: 7517 (nginx)
   CGroup: /system.slice/nginx.service
           ├─7517 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
           └─7518 nginx: worker process

nginx rights issue (13: Permission denied) solution

Modify nginx.conf

Find the 
user nobody changed: user root stop nginx
- S STOP restart nginx -c nginx.conf

 

Guess you like

Origin www.cnblogs.com/xiao-apple36/p/12571941.html