Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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; # 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.

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.