400 Bad Request | The plain HTTP request was sent to HTTPS port
配置好SSL以后,访问https的正常,但是访问http的时候就会提示400 Bad RequestThe plain HTTP request was sent to HTTPS portnginx/0.7.67
我的配置文件如下
server
{
listen 80;
listen 443;
server_name www.aaa.com;
index index.html index.htm index.php;
root/home/wwwroot;
ssl on;
ssl_certificate /root/aaa.crt;
ssl_certificate_key /root/aaa.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
location ~ .*\.(php|php5)?$
{
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
fastcgi_param HTTPS on;
include fcgi.conf;
}
location /status {
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
log_formataccess'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log/home/wwwlogs/access.logaccess;
}
求解决方法,我想让http 和 https同时生效 我分别新建了两个server,问题是一样的
server
{
listen 80;
server_name www.aaa.com;
index index.html index.htm index.php;
root/home/wwwroot;
.....
}
server
{
listen 443;
server_name www.aaa.com;
index index.html index.htm index.php;
root/home/wwwroot;
.....
} 如果不介意我打个广告的话
看这里:
http://yywudi.info/nginx-https-400-bad-request-solution/
页:
[1]