Instalación de DokuWiki en Nginx

Se da por supuesto que Nginx ya está configurado para ejecutar código PHP. Antes de seguir con el procedimiento, se puede seguir este tutorial de instalación de NginX con soporte PHP en FreeBSD.

El server para DokuWiki tendrá este aspecto:

server {
        listen  80;
        server_name dokuwiki.example.com;

        access_log      /var/log/nginx/dokuwiki.example.com-access.log main;

        location / {
            root   /usr/local/www/nginx/dokuwiki;
            index  doku.php;
            try_files $uri $uri/ @dokuwiki;
        }

        # Nice URLs to 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;
        }

        # Deny directory access in Dokuwiki
        location ~ /(data|conf|bin|inc)/ {
                deny all;
        }
        # Deny access to .htaccess files
        location ~ /\.ht {
            deny  all;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;
        }

        # Let nginx know how to handle PHP using fastcgi
        location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/local/www/nginx/dokuwiki$fastcgi_script_name;
            include        fastcgi_params;
        }
}

Referencias

es/misc/dokuwiki/nginx.txt · Last modified: 2012/08/03 21:15 by jfcastro
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki