Error 400 Bad Request not working

Discussion in 'Installation/Configuration' started by Mikeh1, Apr 12, 2012.

  1. Mikeh1

    Mikeh1 New Member


    My current ISPConfig3 installation is currently accessible under an https://..:8080 connection. I have a working SSL certificate and the site is working properly. However, when I browse to http://..:8080 I don't get a site.. Just half of the source code like this:

    <title>400 Bad Request</title>
    <h1>Bad Request</h1>
    <p>Your browser sent a request that this server could not understand.<br />
    Reason: You're speaking plain HTTP to an SSL-enabled server port.<br />
    Instead use the HTTPS scheme to access this URL, please.<br />
    <blockquote>Hint: <a href="https://..:8080/"><b>https://..:8080/</b></a></blockquote></p>
    This is under Firefox. When I try it with Internet Explorer I just get an empty page. How could I fix this problem so the browser processes the HTML code properly? And is it possible to rewrite the http to https with apache mod_rewrite?

    I've tried entering;

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    In a .htaccess file but that didn't work :(

    I've no idea where I should enter that bit of code. I've also tried the ispconfig.vhost file but that didn't work either.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You have a https enabled vhost on port 8080 and such a vhost can only speak https and not http. You can not rewrite that as there is no http vhost where for non https could arrive as one port can only answer to one protocol at a time in apache (and most likely any other webserver), so thats not a issue in ispconfig nor a wrong configuration that you get a error message. To understand that better please remmeber that http and https is normally under two ports (80 and 443) and the browser tries a default fallback in such a case which you could detect with mod_rewrite. There is no such option if you use different ports then 80 and 443.
  3. Mikeh1

    Mikeh1 New Member

    Ah that does make sense yea.. :rolleyes:

    How about the other problem with the error page 400 not displaying correctly? It's showing HTML tags in Firefox while Internet Explorer just gives a blank page when browsing to http:// instead of https://.
    Is that the same problem with the ports?

  4. till

    till Super Moderator Staff Member ISPConfig Developer

    I've no idea why firefox displays it as sourcecode, chrome renders it correctly and ie does not seem to be able to display it at all. Maybe someone else has a good idea on that :)
  5. ikt

    ikt New Member

    sorry to bump an old thread but does anyone have any ideas about getting the 400 bad request to not show just the source code and where is the file to edit it?

Share This Page