网站申请的SSL证书
配置了http和https,http自动rewrite到https
两天前一直没问题,前天在服务器上加了nodejs,二级域名跳转到nodejs
然后就出现了https访问没问题,http大部分时间访问,间歇性能访问
nginx的access.log中有如下信息:
[20/Dec/2013:20:23:33 +0800] "GET / HTTP/1.1" 301 184 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.41 Safari/537.36"
error.log中信息如下:
2013/12/20 20:33:14 [notice] 12119#0: *279 "^(.*)$" matches "/", client: xxx.xxx.xxx.xxx, server: host111.com, request: "HEAD / HTTP/1.1", host: "host111.com"
2013/12/20 20:33:14 [notice] 12119#0: *279 rewritten redirect: "https://host111.com/", client: xxx.xxx.xxx.xxx, server: host111.com, request: "HEAD / HTTP/1.1", host: "host111.com"
2013/12/20 20:33:14 [info] 12119#0: *279 writev() failed (104: Connection reset by peer), client: xxx.xxx.xxx.xxx, server: host111.com, request: "HEAD / HTTP/1.1", host: "host111.com"
nginx配置文件如下,请高手指点一下,感谢~
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##
#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;
##
#big request
##
client_max_body_size 100m;
##
# Virtual Host Configs
##
upstream tomcat1 {
server 127.0.0.1:8080;
}
upstream nodejs {
server 127.0.0.1:8000;
}
server{
listen 80;
server_name abc.host111.com;
location / {
proxy_pass
http://nodejs; proxy_set_header X-Real-IP $remote_addr;
}
}
server{
listen 80;
server_name host111.com www.host111.com;
#fource ssl
rewrite ^(.*)$ https://$host$1 permanent;
location / {
# index /web/html/index.html;
proxy_pass
http://tomcat1; proxy_set_header X-Real-IP $remote_addr;
# root /web/html;
}
error_page 502 /502.html;
location /502.html{
root /static;
}
}
server{
server_name host111.com www.host111.com;
location / {
proxy_pass
http://tomcat1; proxy_set_header X-Real-IP $remote_addr;
}
error_page 502 /502.html;
location /502.html{
root /web/html;
}
#rewrite /m
location /m{
rewrite ^(.*) /m.html;
}
location /m.html{
root /web/html;
}
#ssl
listen 443 ssl;
ssl on;
ssl_certificate /ssl-unified.crt;
ssl_certificate_key /ssl.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
}
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
--
修改:Lydia FROM 211.99.222.*
FROM 211.99.222.*