Welcome! Log In Create A New Profile

Advanced

Re: Support for both HTTP and HTTPS requests on port 443

October 27, 2010 09:54AM
On Wed, Oct 27, 2010 at 04:42:54PM +0300, Pasi Kärkkäinen wrote:

> Hello,
>
> I have HTTPS/SSL server configured like this:
>
> server {
> listen 1.2.3.4:443 ssl;
> server_name ssl.dom.tld
>
> ssl on;
> keepalive_timeout 70;
>
> access_log /var/log/nginx/ssl-access.log;
> error_log /var/log/nginx/ssl-error.log;
>
> location / {
>
> proxy_pass https://10.0.0.1;
>
> proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> proxy_redirect off;
> }
> }
>
> Is it possible to forward also *http* (not https) requests made to port 443
> to the backend (10.0.0.1) port 443 ?
>
> Yes I know, it doesn't make any sense basicly, but I have a broken
> application that wants to receive both http and https requests on port 443.
>
> Is that possible with nginx?

I did not tested this, but you may try:

error_page 497 = @no_https;

location @no_https {
proxy_pass https://10.0.0.1;

proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
}


--
Igor Sysoev
http://sysoev.ru/en/

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

Support for both HTTP and HTTPS requests on port 443

Pasi Kärkkäinen October 27, 2010 09:46AM

Re: Support for both HTTP and HTTPS requests on port 443

Igor Sysoev October 27, 2010 09:54AM

Re: Support for both HTTP and HTTPS requests on port 443

Pasi Kärkkäinen November 02, 2010 04:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 125
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready