Welcome! Log In Create A New Profile

Advanced

Re: http to https rewrite, non-standard port?

Maxim Dounin
August 03, 2011 04:44AM
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

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

http to https rewrite, non-standard port?

J2R December 06, 2010 06:52AM

Re: http to https rewrite, non-standard port?

Igor Sysoev December 06, 2010 07:04AM

Re: http to https rewrite, non-standard port?

Quincy August 03, 2011 04:20AM

Re: http to https rewrite, non-standard port?

cyberjar09 January 07, 2013 05:01AM

Re: http to https rewrite, non-standard port?

Maxim Dounin August 03, 2011 04:44AM

Re: http to https rewrite, non-standard port?

Igor Sysoev August 03, 2011 03:10PM

Re: http to https rewrite, non-standard port?

Igor Sysoev August 03, 2011 03:06PM

Re: http to https rewrite, non-standard port?

Quincy August 04, 2011 05:04AM

Re: http to https rewrite, non-standard port?

cyberjar09 January 07, 2013 04:16AM

Re: http to https rewrite, non-standard port?

cyberjar09 January 07, 2013 04:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 70
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready