Apache ssl-enabled vhost returns random 400 bad requests

I installed two local vhosts (http and self-signed https) for billing.example.com and tried them in firefox with firebug. Http vhost only target redirects all requests to https.

Almost every time I request a page from https, one or two files with related resources (images, js, css, etc.), and sometimes the php page itself returns 400 bad requests in the firebug window, sometimes one or two files are displayed as loaded for a long time. When I click on the problem link in firebug, the file loads as it should. In addition, files with poor or no download request change almost every time I load a page.

Any ideas?

Server: Ubuntu 10.04, Apache / 2.2.14 with mod_ssl

Hosts:

Listen 80 <VirtualHost *:80> ServerName billing.example.com UseCanonicalName On DocumentRoot /code/site/billing ... RewriteEngine On RewriteRule ^/(.*)$ https://billing.example.com/$1 </VirtualHost> Listen 443 <VirtualHost *:443> ServerName billing.example.com UseCanonicalName On DocumentRoot /code/site/billing ... SSLEngine On SSLCertificateFile /code/site/ssl/example.crt SSLCertificateKeyFile /code/site/ssl/example.key </VirtualHost> 

Rest - default settings from ubuntu apache2.

+4
source share
2 answers

For the ssl part, you might want to turn UseCanonicalName Off For virtual hosts, you are probably using a different domain than the main server, and this may make you look for files outside of the virtual host.

For completeness, on port 80, I will add [R, L] to the redirection.

 RewriteEngine On RewriteRule ^/(.*) http://billing.example.com/$1 [L,R] 
0
source

I had this problem with apache 2.2.9, and updating to apache 2.2.22 solved the problem for me.

I would get random 400 responses to some requests per page. Sometimes images, sometimes AJAX requests. Sometimes it would be the page itself, which would return 400 along with this message.

Bad request. Your browser sent a request that this server could not understand. There is no :: separator in the request header field. live

I found the following carpet report that seemed to be tied. Bug fixed in apache 2.2.15: https://bugzilla.redhat.com/show_bug.cgi?id=652335

I think this error is the cause of many random errors when using https: Your browser sent a request that this server could not understand. There is no ":" separator in the request header field.

So I thought I would try upgrading to the latest apache with the latest mod_ssl - and that seemed to work.

0
source

All Articles