您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> Linux >> 配置nginx文件时启动报错nginxserviceJob for nginxservice failed

配置nginx文件时启动报错nginxserviceJob for nginxservice failed(1/2)

来源:网络整理     时间:2017/9/5 0:37:45     关键词:

关于网友提出的“ 配置nginx文件时启动报错nginxserviceJob for nginxservice failed”问题疑问,本网通过在网上对“ 配置nginx文件时启动报错nginxserviceJob for nginxservice failed”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题: 配置nginx文件时启动报错nginxserviceJob for nginxservice failed
描述:

环境:ubuntu 16.04
nginx 最新版本

新手第一次搭建
问题:

在/etc/nginx/conf.d这个文件下 没有默认配置文件
我创建配置文件是在/etc/nginx/conf.d这个目录系下,文件名是:city.conf
server {   # 这个server标识我要配置了
        listen 80;
        server_name 192.168.17.129 ;
        access_log  /var/log/nginx/access.log  main;
        charset  utf-8;
        gzip on;
        gzip_types text/plain application/x-javascript text/css text/javascript application/x-httpd-php application/json text/json image/jpeg image/gif image/png application/octet-stream;

        error_page  404           /404.html;
        error_page   500 502 503 504  /50x.html;

        # 指定项目路径uwsgi
        location / {        # 这个location就和咱们Django的url(r'^admin/', admin.site.urls),
            include uwsgi_params;  # 导入一个Nginx模块他是用来和uWSGI进行通讯的
            uwsgi_connect_timeout 30;  # 设置连接uWSGI超时时间
            uwsgi_pass unix:/home/script/uwsgi.sock;  # 指定uwsgi的sock文件所有动态请求就会直接丢给他
        }

        # 指定静态文件路径
        location /static/ {
            alias  /home/trunk/static/;
            index  index.html index.htm;
        }

提示错误:
Starting nginx (via systemctl): nginx.serviceJob for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

网上说这种错误一般都是目录不存在或者权限不足,所以直接执行下面两条命令即可。

[root@typecodes ~]# cd /var/tmp/

[root@typecodes ~]# mkdir -p /var/tmp/nginx/{client,proxy,fastcgi,uwsgi,scgi}

我按照这两个提示做了 没有反应

systemctl status nginx.service错误提示:

相关图片

相关文章