Не знаю, как отлаживать журнал ошибок nginx

0

У меня проблема с настройкой nginx. Когда я помещаю http://192.168.214.164 в веб-браузер, я получаю nginx Произошла ошибка веб-страницы. К сожалению, страница, которую вы ищете, в настоящее время недоступна. Повторите попытку позже... С уважением, nginx. Может кто-то, пожалуйста, помогите мне отладить файл nginx-error.log и помочь мне настроить сервер, чтобы он работал?

С уважением

Это мои файлы конфигурации:
Файл nginx.conf

user nginx;
worker_processes  auto;
error_log       /var/log/nginx/nginx-error.log debug;
pid        /var/run/nginx.pid;

events {
   use epoll;
}

http {

    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format main   '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent"
                      cache: $upstream_cache_status '
                      'upstream: $upstream_addr in $upstream_response_time sec';

    access_log /var/log/nginx/nginx-access.log main;

    sendfile        on;
    #keepalive_timeout  65;

    include /etc/nginx/conf.d/webportal.conf;

    }

webportal.conf

server {

    listen 192.168.214.164:80;

    charset utf-8;
    access_log /var/log/bswp_log/bswp.access.log;
    error_log /var/log/bswp_log/bswp.error.log error;

    root   /var/www/html/bswp.tv/browser;
    index  index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$args;
        location ~ \.php$ {
                root           /var/www/html/bswp.tv/browser;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_intercept_errors on;
                fastcgi_index  index.php;
                fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include         fastcgi_params;
              }

        location /upload/ {
                try_files $uri @dynImage;
                rewrite_log on;
        }
    }

    location @dynImage {
         rewrite (([^/]+)\.(jpe?g|png))(\?(\d))?&?(random=\d+?)?$ /image_loader.php?file=$1&$query_string;
    }

    #error_page  404              /404.html;
    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # deny access to .htaccess files, if Apache document root
    # concurs with nginx one
    location ~ /\.ht {
        deny  all;
    }
}

Это nginx-error.log

2015/02/16 11:00:50 [notice] 1766#0: signal 17 (SIGCHLD) received
2015/02/16 11:00:50 [notice] 1766#0: worker process 1768 exited with code 0
2015/02/16 11:00:50 [notice] 1766#0: exit
2015/02/16 11:02:33 [notice] 1837#0: using the "epoll" event method
2015/02/16 11:02:33 [notice] 1837#0: nginx/1.6.2
2015/02/16 11:02:33 [notice] 1837#0: built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
2015/02/16 11:02:33 [notice] 1837#0: OS: Linux 2.6.32-504.8.1.el6.x86_64
2015/02/16 11:02:33 [notice] 1837#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2015/02/16 11:02:33 [notice] 1838#0: start worker processes
2015/02/16 11:02:33 [notice] 1838#0: start worker process 1840
2015/02/16 11:04:06 [notice] 1838#0: signal 15 (SIGTERM) received, exiting
2015/02/16 11:04:06 [notice] 1840#0: exiting
2015/02/16 11:04:06 [notice] 1840#0: exit
2015/02/16 11:04:06 [notice] 1838#0: signal 17 (SIGCHLD) received
2015/02/16 11:04:06 [notice] 1838#0: worker process 1840 exited with code 0
2015/02/16 11:04:06 [notice] 1838#0: exit
2015/02/16 11:04:07 [notice] 1860#0: using the "epoll" event method
2015/02/16 11:04:07 [notice] 1860#0: nginx/1.6.2
2015/02/16 11:04:07 [notice] 1860#0: built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
2015/02/16 11:04:07 [notice] 1860#0: OS: Linux 2.6.32-504.8.1.el6.x86_64
2015/02/16 11:04:07 [notice] 1860#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2015/02/16 11:04:07 [notice] 1861#0: start worker processes
2015/02/16 11:04:07 [notice] 1861#0: start worker process 1863
2015/02/16 11:38:59 [notice] 1861#0: signal 15 (SIGTERM) received, exiting
2015/02/16 11:38:59 [notice] 1863#0: exiting
2015/02/16 11:38:59 [notice] 1863#0: exit
2015/02/16 11:38:59 [notice] 1861#0: signal 17 (SIGCHLD) received
2015/02/16 11:38:59 [notice] 1861#0: worker process 1863 exited with code 0
2015/02/16 11:38:59 [notice] 1861#0: exit
2015/02/16 11:38:59 [notice] 1945#0: using the "epoll" event method
2015/02/16 11:38:59 [notice] 1945#0: nginx/1.6.2
2015/02/16 11:38:59 [notice] 1945#0: built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
2015/02/16 11:38:59 [notice] 1945#0: OS: Linux 2.6.32-504.8.1.el6.x86_64
2015/02/16 11:38:59 [notice] 1945#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2015/02/16 11:38:59 [notice] 1946#0: start worker processes
2015/02/16 11:38:59 [notice] 1946#0: start worker process 1948
2015/02/16 11:42:35 [notice] 1946#0: signal 15 (SIGTERM) received, exiting
2015/02/16 11:42:35 [notice] 1948#0: exiting
2015/02/16 11:42:35 [notice] 1948#0: exit
2015/02/16 11:42:35 [notice] 1946#0: signal 17 (SIGCHLD) received
2015/02/16 11:42:35 [notice] 1946#0: worker process 1948 exited with code 0
Теги:
nginx

1 ответ

1
Лучший ответ

отключите fastcgi_intercept_errors - ваш PHP-код, скорее всего, будет ошибкой, а nginx перехватит его и вернет страницу с ошибкой http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_intercept_errors

  • 0
    Да! Хорошая работа, сэр! Я могу двигаться вперед сейчас. Спасибо!

Ещё вопросы

Сообщество Overcoder
Наверх
Меню