http to https rewrite, non-standard port?
Maxim Dounin
mdounin at mdounin.ru
Wed Aug 3 08:42:43 UTC 2011
Hello!
On Wed, Aug 03, 2011 at 04:20:39AM -0400, Quincy wrote:
> I have the same problem. I can't redirect http to https. Here is my
> config:
>
> server {
> listen 2121;
> server_name XXXXX;
> ssl on;
> ssl_certificate XXt;
> ssl_certificate_key XX;
> #server_name _;
> server_name_in_redirect off;
> port_in_redirect off;
>
> root XXX;
>
> location / {
> index index.php;
> error_page 404 = @mediawiki;
> error_page 497 = @https;
Setting "error_page 497" is usesless as nginx won't read and parse
http headers for invalid requests. Move it to server level.
[...]
> Https is working flawlessly, but when I try http I get an error (400 Bad
> Request
>
> The plain HTTP request was sent to HTTPS port
> nginx/1.0.5) instead of redirect.
Expected, as you don't have error_page 497 defined at server
level, hence nginx uses the default.
Maxim Dounin
More information about the nginx
mailing list