From 3c3580ae6c7ddf7cc0615d118656b13a7fc233d7 Mon Sep 17 00:00:00 2001 From: Bimon <Bimon@ispconfig3> Date: Thu, 06 Sep 2012 12:33:43 -0400 Subject: [PATCH] avoid 400 bad request error if ssl is enabled and interface is accessed with http instead of https. Instead redirect to the requested page with https at the beginning of the URL. --- install/tpl/nginx_ispconfig.vhost.master | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/install/tpl/nginx_ispconfig.vhost.master b/install/tpl/nginx_ispconfig.vhost.master index 72fbacf..74372f6 100644 --- a/install/tpl/nginx_ispconfig.vhost.master +++ b/install/tpl/nginx_ispconfig.vhost.master @@ -1,8 +1,11 @@ server { listen {vhost_port}; - ssl {ssl_on}; + ssl {ssl_on}; {ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt; {ssl_comment}ssl_certificate_key /usr/local/ispconfig/interface/ssl/ispserver.key; + + # redirect to https if accessed with http + {ssl_comment}error_page 497 https://$host:{vhost_port}$request_uri; server_name _; -- Gitblit v1.9.1