小编use*_*928的帖子

Nginx没有运行,没有错误消息

我正在尝试启动我的nginx服务器.当我输入"$> /etc/init.d/nginx start"时,我看到一条消息显示为"Starting nginx:",然后没有任何反应.没有错误消息,当我检查nginx的状态时,我发现它没有运行.

这是我的/etc/nginx/nginx.conf文件:

worker_processes  4;
daemon off;

error_log  /home/vincent/tmp/nginx.log;

pid        /home/vincent/tmp/nginx.pid;


events {
    worker_connections  1024;
}


http {
default_type  application/octet-stream;

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  /home/vincent/tmp/access.log  main;

sendfile        on;

keepalive_timeout  65;

include /etc/nginx/site-enabled/*;
Run Code Online (Sandbox Code Playgroud)

}

这是我的/ etc/nginx/sites-available/default文件:

server {
  listen       80;
  server_name technical-test.neo9.lan; 

  access_log  /var/log/nginx/technical-test.neo9.lan.log main;

  set $home /home/vincent;

  location / {
    alias $home/neo9/web/app/;
    index  index.html;
  }

  location /api/ {
    rewrite  ^/api/(.*)$  /$1 break;
    proxy_pass http://localhost:1234;
    proxy_set_header Host $host; …
Run Code Online (Sandbox Code Playgroud)

nginx

60
推荐指数
5
解决办法
10万
查看次数

标签 统计

nginx ×1