老师,重启nginx最后两步出现异常,应该是哪方面问题呢?
来源:17-7 uwsgi和nginx配置
慕侠3297407
2021-10-05
Xshell 7 (Build 0085)
Copyright © 2020 NetSarang Computer, Inc. All rights reserved.
Type `help’ to learn how to use Xshell prompt.
[C:~]$
Connecting to 39.105.208.151:22…
Connection established.
To escape to local shell, press ‘Ctrl+Alt+]’.
WARNING! The remote SSH server rejected X11 forwarding request.
Last login: Tue Oct 5 01:23:28 2021 from 119.186.75.31
Welcome to Alibaba Cloud Elastic Compute Service !
[root@iZ2ze17576m2eqmvvfsbq0Z ~]# ls
ashang Python-3.7.3.tgz
[root@iZ2ze17576m2eqmvvfsbq0Z ~]# cd ashang/
[root@iZ2ze17576m2eqmvvfsbq0Z ashang]# ls
apps ashang conf manage.py requirements.txt static templates xadmin
[root@iZ2ze17576m2eqmvvfsbq0Z ashang]# cd conf
[root@iZ2ze17576m2eqmvvfsbq0Z conf]# ls
nginx uwsgi
[root@iZ2ze17576m2eqmvvfsbq0Z conf]# cd nginx/
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# ls
uc_nginx.conf
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# cp uc_nginx.conf /etc/nginx/conf.d/
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# ls /etc/nginx/conf.d/
uc_nginx.conf
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# vim /etc/nginx/
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# vim /etc/nginx/
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# vim /etc/nginx/nginx.conf
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# sudo systemctl restart nginx
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# sudo systemctl restart nginx
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# ps aux|grep nginx
root 379 0.0 0.1 112708 984 pts/2 S+ 02:34 0:00 grep --color=auto nginx
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# sudo systemctl start nginx
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# ls /etc/nginx/conf.d/
uc_nginx.conf
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# vim /etc/nginx/
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# ls
uc_nginx.conf
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# /etc/nginx/
-bash: /etc/nginx/: Is a directory
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# vim /etc/nginx/nginx.conf
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# sudo systemctl restart nginx
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
[root@iZ2ze17576m2eqmvvfsbq0Z nginx]# sudo systemctl restart nginx
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
3回答
-
慕侠3297407
提问者
2021-10-05
有红线提示
042021-10-22 -
慕侠3297407
提问者
2021-10-05
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user root;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 4096;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80;
listen [::]:80;
server_name _;
"/etc/nginx/nginx.conf" 84L, 2335C
00 -
慕侠3297407
提问者
2021-10-05
[root@iZ2ze17576m2eqmvvfsbq0Z ~]# nginx -t
nginx: [emerg] unknown directive "alias/root/ashang/media" in /etc/nginx/conf.d/uc_nginx.conf:20
nginx: configuration file /etc/nginx/nginx.conf test failed
[root@iZ2ze17576m2eqmvvfsbq0Z ~]# nginx -tc /etc/nginx/nginx.conf
nginx: [emerg] unknown directive "alias/root/ashang/media" in /etc/nginx/conf.d/uc_nginx.conf:20
nginx: configuration file /etc/nginx/nginx.conf test failed
[root@iZ2ze17576m2eqmvvfsbq0Z ~]#
042021-10-05
相似问题