Hi everyone,
here is my current setup:
1. nginx proxy with following config:
upstream wiki {
server 192.168.15.252:3090;
}
server {
port_in_redirect off;
#listen 80;
listen 443;
server_name xyz;
server_tokens off;
ssl on;
ssl_certificate /etc/nginx/ssl/cxz.crt;
ssl_certificate_key /etc/nginx/ssl/xyz.key;
location / {
proxy_pass http://wiki;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect default;
#proxy_redirect https://xyzt:3090/ /;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
here the actual server which is running dokuwiki:
server {
server_name xyz;
listen 3090 default_server;
root /home/xyz/wiki/doku;
server_tokens off;
#proxy_set_header $host:443
port_in_redirect off;
# proxy setup
set_real_ip_from 192.168.15.50;
real_ip_header X-Real-IP;
location / {
index doku.php index.html index.php;
try_files $uri $uri/ @dokuwiki;
}
location @dokuwiki {
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;
rewrite ^/(.*) /doku.php?id=$1 last;
}
location ~ /(data|conf|bin|inc)/ {
deny all;
}
location ~ /\.ht {
deny all;
}
# serve static files
location ~ ^/dokuwiki/lib/^((?!php).)*$ {
root /home/xyz/wiki/doku/lib;
expires 30d;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $uri; #necessary for URL rewrite
}
}
Regular surfing is working fine. What is not working, are the redirects after post/update/destroy actions.
It always redirects me to
http://xyz:3090 instead of
https://xyz
Is dokuwiki using the $_SERVER["SERVER_PORT"] for generating the urls for the redirects?
I tried different settings that i have found via google but none were working.
The setup works in general for other projects. I tried it with mediawiki or my other projects i use with unicorn web server.
Any ideas?