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.