Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to host a TWiki ( in a nginx dedicated server, but I'm unable to setup rewrite rules to effectively host the wiki environment. Looking at this oficial documentation: ( 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: 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; # 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;
                # 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.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.