Welcome! Log In Create A New Profile

Advanced

HTTPS to HTTP apache backend

Posted by brctl 
HTTPS to HTTP apache backend
November 24, 2011 08:20AM
Hello there.
I am using nginx as reverse proxy. HTTP and HTTPS requests are forwarded via nginx to HTTP of backend server (no re-encryption for HTTPS).
Backend www server is apache.

Configuration of nginx reverse proxy for one domain:

server {
listen 80;
listen 443 ssl;
server_name *.domain.net;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
ssl_certificate ssl/domain.net/server.crt;
ssl_certificate_key ssl/domain.net/server.key;
location / {
proxy_pass http://192.168.0.12;
}

I have following problem:
Regular HTTP and HTTPS works well, but i get one problematic point. When I force in apache redirection to HTTPS, for example via .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

given URL where this is applied is not available. Each browser reports something different. Opera show something about not allowed redirection to itself, Internet Explorer show only that page cannot be displayed.

Have someone experienced this problem?

Thansk for replies.
V.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 289
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready