错误请求400:nginx运行状况检查/状态

时间:2014-06-19 09:59:11

标签: nginx

我正在对我的nginx服务器进行健康检查我一直在

不同的状态,它应该只返回200但是它仍然存在400个不良请求,如下所示

  

10.10.25.2 - - [19 / Jun / 2014:13:55:06 +0400]“GET / status / HTTP / 1.0”200 0“ - ”“ - ”“ - ”   10.10.25.3 - - [19 / Jun / 2014:13:55:07 +0400]“GET / status / HTTP / 1.0”200 0“ - ”“ - ”“ - ”   10.10.25.2 - - [19 / Jun / 2014:13:55:08 +0400]“GET / status / HTTP / 1.0”400 264“ - ”“ - ”“ - ”   10.10.25.3 - - [19 / Jun / 2014:13:55:09 +0400]“GET / status / HTTP / 1.0”400 264“ - ”“ - ”“ - ”

错误日志:

client sent plain HTTP request to HTTPS port while reading client request headers

这是我的Nginx设置!我错过了什么吗?

worker_processes  1;
error_log  logs/error.log info;
pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include   mime.types;
    default_type text/html;
    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  logs/access.log  main;
    sendfile        on;
    keepalive_timeout  65;
    server_tokens off;
    add_header X-Frame-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";

    gzip  on;
    include /etc/nginx/conf.d/*.conf;

server {
        listen       80;
        listen 443;
        server_name  localhost;
        access_log  logs/host.access.log  main;
        ssl                  on;
        ssl_certificate      /etc/nginx/conf/self-ssl.crt;
        ssl_certificate_key  /etc/nginx/conf/self-ssl.key;
        ssl_session_timeout  5m;
        ssl_protocols  SSLv2 SSLv3 TLSv1;
        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers   on;

    }

}

1 个答案:

答案 0 :(得分:0)

删除ssl on并将ssl修饰符添加到listen 443

server {
    listen 80;
    listen 443 ssl;
    server_name  localhost;
    access_log  logs/host.access.log  main;
    ssl_certificate      /etc/nginx/conf/self-ssl.crt;
    ...