I'm trying to host a TWiki (http://twiki.org) in a nginx dedicated server, but I'm unable to setup rewrite rules to effectively host the wiki environment. Looking at this oficial documentation: (http://twiki.org/cgi-bin/view/Codev/TWikiOnNginx) I tried to adapt it to our necessities, but this example covers a specific case where the wiki is hosted on /twiki address and I would like to host it on the root of the website.
It's working now if I put the full address on the address bar, for example: http://twiki.example.com/bin/view
but the rewrite rules should do this for me automatically.
The modified configuration running is this one:
# Start of TWiki specific settings
#location ~ ^/ {
location / {
rewrite ^/([A-Z].*) /bin/view/$1;
rewrite ^/edit/(.*) /bin/edit/$1;
#deny all;
allow all;
location ~ ^/pub/ { allow all; }
location ~ ^/bin/configure {
#allow 192.168.0.100; # When you configure your TWiki, remove "#" and set your IP address.
#allow all;
deny all;
gzip off;
# Enter your fcgiwrap socket here
fastcgi_pass fcgiwrap;
fastcgi_index index.pl;
# Enter your TWiki cgi-bin path
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/bin/ {
allow all;
fastcgi_pass fcgiwrap;
fastcgi_split_path_info ^(/bin/[^/]+)(/.*)$;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Any help is appreciated.