Not logged in. · Lost password · Register

All posts by abhishek.mukher.g (2)

topic: NGINX SSL 400 Error [SOLVED] (nginx + https + dokuwiki == sad?)  in the forum: General Help and Support Installation and Configuration
Avatar
abhishek.mukher.g #1
Member since Jan 2010 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Solved
Got it. that's exactly what I was looking for. I fixed it by changing my SSL server's config to.
  location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /var/www/dokuwiki$fastcgi_script_name;
    fastcgi_param HTTPS True;
    fastcgi_pass localhost:9000;
  }

The key line would be adding fastcgi_param HTTPS True;

TYVM Andi :)
topic: NGINX SSL 400 Error [SOLVED] (nginx + https + dokuwiki == sad?)  in the forum: General Help and Support Installation and Configuration
Avatar
abhishek.mukher.g #2
Member since Jan 2010 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: NGINX SSL 400 Error [SOLVED]
Hello all,

I'm having some issues setting up HTTPS for my dokuwiki server. It works mostly properly except for two things
1) CSS seems to be different. I'm not too worried about this right now
2) After login and logout, I get 400 errors from nginx. The reason is my browser has been redirected to http://foo.bar.com:443/start. Nginx is seeing the input on 443 is not SSL encrypted and throwing the error. This could be happening in more places than just login and logout but I have not seen.

So my question is: why is dokuwiki's login page redirecting to http://...:443 rather than https://...? Am I missing a header that I'm supposed to be passing to the fast_cgi processes?

This is the same issue as: http://forum.dokuwiki.org/thread/2416, which never got resolved.

Nginx Configs:
(The :80 version works fine, the :443 version does now)
server {
  listen 80;
  server_name foo.bar.com;

  root /var/www/dokuwiki;
  index index.php;

  rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
  rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
  rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;

  location / {
    if (!-f $request_filename) {
      rewrite ^(.*)?(.*) /doku.php?id=$1&$2 last;
      rewrite ^$ /doku.php last;
    }

    if (-f $request_filename) {
      expires 24h;
    }
  }

  location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /var/www/dokuwiki$fastcgi_script_name;
    fastcgi_pass localhost:9000;
  }
}

server {
  listen 443;
  server_name foo.bar.com;

  root /var/www/dokuwiki;
  index index.php;

  ssl on;
  ssl_certificate /etc/ssl/certs/dokuwiki.crt;
  ssl_certificate_key /etc/ssl/private/dokuwiki.key;
  ssl_client_certificate /etc/ssl/certs/cacert.pem;

  rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
  rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
  rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;

  location / {
    if (!-f $request_filename) {
      rewrite ^(.*)?(.*) /doku.php?id=$1&$2 last;
      rewrite ^$ /doku.php last;
    }

    if (-f $request_filename) {
      expires 24h;
    }
  }

  location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /var/www/dokuwiki$fastcgi_script_name;
    fastcgi_pass localhost:9000;
  }
}
This post was edited on 2010-01-20, 19:44 by abhishek.mukher.g.
Close Smaller – Larger + Reply to this post:
Special characters:
Special queries
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-07-23, 13:35:44 (UTC +02:00)