我正在检查我的nginx服务器,我一直收到
不同的状态,它应该只返回200,但它保留了400个坏请求,如下所示
10.10.25.2——[19日/0400年6月/2014:13:55:06 +]"GET/地位/HTTP/1.0"200 0 "-" "-" "-"10.10.25.3——[19日/0400年6月/2014:13:55:07 +]"GET/地位/HTTP/1.0"200 0 "-" "-" "-"10.10.25.2——[19日/0400年6月/2014:13:55:08 +]"GET/地位/HTTP/1.0"400年264年 "-" "-" "-"10.10.25.3——[19日/0400年6月/2014:13:55:09 +]"GET/地位/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;
}
}
去掉ssl on
,给listen 443
添加ssl
改性剂
server {
listen 80;
listen 443 ssl;
server_name localhost;
access_log logs/host.access.log main;
ssl_certificate /etc/nginx/conf/self-ssl.crt;
...