nginx启动使用自定义配置文件出现段错误(Segmentation fault),求大神解答

拧世界发条的拧发条鸟 发布于 2017/07/02 17:28
阅读 886
收藏 0

nginx版本:

nginx version: nginx/1.12.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) 
configure arguments: --prefix=/home/thumbnail/suoluetu/nginx --with-http_stub_status_module --pid-path=/home/thumbnail/suoluetu/nginx/nginx.pid --with-pcre=/eyunext/installpackage/install_4.14/pcre-8.32 --with-zlib=/eyunext/installpackage/install_4.14/zlib-1.2.8 --add-module=/eyunext/installpackage/install_4.14/ngx_slowfs_cache-1.10 --add-module=/eyunext/installpackage/install_4.14/ngx_cache_purge-2.3
 

 

 

nginx自定义配置文件:

user root;
worker_processes 4;
pid /home/thumbnail/suoluetu/nginx/nginx.pid;

events {
worker_connections 1024;
}


http {

    include mime.types;
    default_type application/octet-stream;
#    include /usr/local/nginx/conf/mime.types;

#    charset utf-8;

    server_names_hash_bucket_size 128;
    client_header_buffer_size 16k;
    large_client_header_buffers 4 32k;
    client_max_body_size 3072m;

    sendfile on;
    tcp_nopush on;

    keepalive_timeout 60;
        send_timeout 60;
    tcp_nodelay on;
    types_hash_max_size 2048;

    client_body_buffer_size 512k;
    proxy_connect_timeout 50;
    proxy_read_timeout 60;
    proxy_send_timeout 50;
    proxy_buffer_size 16k;
    proxy_buffers 4 64k;
    proxy_busy_buffers_size 128k;
    proxy_temp_file_write_size 128k;
        proxy_next_upstream error timeout invalid_header http_500 http_503;

    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    gzip_http_version 1.1;
    gzip_comp_level 2;
    gzip_types text/plain application/x-javascript text/css application/xml;
    gzip_vary on;

        underscores_in_headers on;
        #daemon off;
        
        limit_conn_zone $binary_remote_addr zone=perip:10m;

    proxy_temp_path /home/thumbnail/suoluetu/nginx/cache/proxy_temp_dir;
    proxy_cache_path /home/thumbnail/suoluetu/nginx/cache/proxy_cache_dir levels=1:2 keys_zone=cache_one:20000m inactive=1d max_size=50g;

        upstream httpserver
         { 
            server 192.168.1.7:8080 max_fails=3  fail_timeout=30s;
       server 192.168.1.8:8080 max_fails=3  fail_timeout=30s;
#        jvm_route $cookie_JSESSIONID reverse;
         }

    slowfs_cache_path  /home/thumbnail/suoluetu/nginx/cache/slowfs_cache_dir levels=1:2 keys_zone=fastcache:10000m inactive=1h max_size=20g;
        slowfs_temp_path   /home/thumbnail/suoluetu/nginx/tmp/slowfs_temp_dir;

        log_format access '[$time_local] cache_status $upstream_cache_status remote_ip $remote_addr  req $request status $status  server_ip $server_addr proxy_host $proxy_host upstream_server_ip $upstream_addr';
    server
    {
          listen 8080; 
       server_name httpserver; 
           root /home/thumbnail/suoluetu/nginx/cache/html;

           location /
               {
        #           deny 192.168.1.1;
    #        deny all;

    #         limit_conn   oneip 800;
                     limit_conn perip 800;
                     proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404;
                     proxy_pass http://httpserver; 
                     proxy_set_header Host $host;
                     proxy_set_header X-Real-IP $remote_addr;
                     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                     
               }
           location ~ /purge/(.*)
             {
               allow 127.0.0.1;
               deny all;
               proxy_cache_purge cache_one $1;
              }


           location ~ /eyunext/thumbnail/(((?!link|stream).)*)/(.*)
           # location ~ /eyunext/thumbnail/(.*)/(.*)
             {
               #set $tmp $host:$server_port$uri;
               #echo $1;
               #echo $2;
               #echo $3;
               #echo $1:$3;
               proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404;
               # limit_conn   oneip 800;
           limit_conn perip 800;
               proxy_cache cache_one;
               proxy_cache_methods GET HEAD POST;
               proxy_cache_min_uses 1;
               proxy_cache_valid 200 302 301 30d;
               proxy_cache_valid 404 1m;
               proxy_cache_valid any 0;
               proxy_cache_key "$3/$1";
               add_header X-Cache $upstream_cache_status;
               #add_header res-time $request_time;
               proxy_redirect off;
               proxy_set_header Host $host;
               proxy_set_header X-Real-IP $remote_addr;
               proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
               proxy_pass http://httpserver;
               expires 30d;
               
              }
           
            #location ~.*/(.*/.*\.(gif|jpg|png|htm|html|css|flv|ico|swf)$)
             location ~ /eyunext/thumbnail/link/(.*)
             #location ~.*/(.*\.(gif|jpg|png|htm|html|css|flv|ico|swf)$)
             {
               #set $tmp $host:$server_port$uri;
               #echo $tmp;
               #echo $1;
               #echo $2;
               #echo $document_uri;
               #echo $request_filename;
               #echo $arg_code;
               #echo $1:$arg_code;
               #echo $upstream_response_time;
               proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404;
               proxy_cache cache_one;
               proxy_cache_methods GET HEAD POST;
               proxy_cache_min_uses 1;
               proxy_cache_valid 200 302 301 30d;
               proxy_cache_valid 404 1m;
               proxy_cache_valid any 0;
               proxy_cache_key "$1:$arg_code";
               add_header X-Cache $upstream_cache_status;
               #add_header res-time $request_time;
               proxy_redirect off;
               proxy_set_header Host $host;
               proxy_set_header X-Real-IP $remote_addr;
               proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
               proxy_pass http://httpserver;
               expires 30d;
             }

             location ~ /eyunext/thumbnail/stream/(.*)/1/(.*)/(.*)$
             {
               #set $tmp $host:$server_port$uri;
               #echo $1;
               #echo $2;
               #echo $3;
               #echo $1:$3;
               proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404;
               #limit_conn   oneip 800;
           limit_conn perip 800;
               proxy_cache cache_one;
               proxy_cache_methods GET HEAD POST;
               proxy_cache_min_uses 1;
               proxy_cache_valid 200 302 301 30d;
               proxy_cache_valid 404 1m;
               proxy_cache_valid any 0;
               proxy_cache_key "$2/$1";
               add_header X-Cache $upstream_cache_status;
               #add_header res-time $request_time;
               proxy_redirect off;
               proxy_set_header Host $host;
               proxy_set_header X-Real-IP $remote_addr;
               proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
               proxy_pass http://httpserver;
               expires 30d;
               
              }

       location /status
         {
           stub_status on;
         }
       location ~ ^/(WEB-INF)/ 
         {
          deny all;
          }        
       location  ~ /public(/.*)
        {

           #echo "pulic";
           #echo $args;
        }
        
    access_log /home/thumbnail/suoluetu/nginx/logs/access.log access;
        #error_log /eyunext/lb/logs/error.log debug;
    }                
}

gdb调试信息

root@localhost sbin]# gdb core.52519?
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-92.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. ?Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Missing separate debuginfo for the main executable file
Try: yum --enablerepo='*-debug*' install /usr/lib/debug/.build-id/6b/f7f2d013d32c48941c705505142c9bbc4d1734
[New Thread 52519]
Core was generated by `./nginx'.
Program terminated with signal 11, Segmentation fault.
#0 ?0x000000000040eba7 in ?? ()
"/home/thumbnail/suoluetu/nginx/sbin/core.52519" is a core file.
Please specify an executable to debug.
(gdb) bt
#0 ?0x000000000040eba7 in ?? ()
#1 ?0x00007fffd316f4d0 in ?? ()
#2 ?0x0000000000ad69a0 in ?? ()
#3 ?0x0000000000abe5e8 in ?? ()
#4 ?0x0000000000452b91 in ?? ()
#5 ?0x0000000000000000 in ?? ()
(gdb) run
No core file now.
Starting program: ?
No executable file specified.
Use the "file" or "exec-file" command.
(gdb) file nginx
Reading symbols from /home/thumbnail/suoluetu/nginx/sbin/nginx...done.
(gdb) bt
No stack.
(gdb) file /home/thumbnail/suoluetu/nginx/conf/nginx.conf
"/home/thumbnail/suoluetu/nginx/conf/nginx.conf": not in executable format: File format not recognized
(gdb)?

加载中
返回顶部
顶部