How to configure phpmyadmin with nginx ?

SE7EN k1_zeus at yahoo.com
Sun Sep 13 23:28:36 MSD 2009


I added this,I verify it, everything is correct, my site works fine but accessing http://mydomain.com/phpmyadmin still doesn't work, a 500 server errror appears.location ~ /phpmyadmin/.*\.php$ {
                 root /usr/share/;
                 fastcgi_pass 127.0.0.1:9002;
                fastcgi_index index.php;
                include /usr/local/nginx/conf/fastcgi_params;
                fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$fastcgi_script_name;
                }

                location /phpmyadmin/ {
                root /usr/share/;
                index index.php;
                }



--- On Sun, 9/13/09, Edho P Arief <edhoprima at gmail.com> wrote:

From: Edho P Arief <edhoprima at gmail.com>
Subject: Re: How to configure phpmyadmin with nginx ?
To: nginx at sysoev.ru
Date: Sunday, September 13, 2009, 9:31 AM

On Sun, Sep 13, 2009 at 4:54 AM, SE7EN<k1_zeus at yahoo.com> wrote:
> Hi, phpmyadmin is installed in /usr/share/phpmyadmin and i have the
> following vhost configuration file. How to configure phpmyadmin so i can
> use: http://mydomain.com/phpmyadmin
>
> Thank you
>
> server {
>   listen 80;
>   server_name www.mydomain.com;
>
>   #redirect www to non-www
>   rewrite ^/(.*) http://mydomain.com/$1 permanent;
>
>
>   }
>
>
> server {
>   listen 80;
>   server_name mydomain.com;
>   access_log /home/mydomain/log/access.log;
>   error_log /home/mydomain/log/error.log;
>

location ~ /phpmyadmin/.*\.php$ {
  root /usr/share/;
  ....php fastcgi settings...;
}

location /phpmyadmin/ {
  root /usr/share/;
  index index.php;
}

>
>
>   location / {
>   root /home/mydomain/public_html/;
>   index index.php index.html;
>   expires 30d;
>
>   #stop image and files hotlinking
>   location ~* ^.+\.(gif|jpg|png|swf|flv|rar|zip|jpeg|css)$ {
>   valid_referers none blocked mydomain.com www.mydomain.com *.google.com
> *.yahoo.com;
>   if ($invalid_referer) {
>   return 444;
>   }
>   }
>
>   #joomla sef url's
>   if (!-e $request_filename) {
>   rewrite ^(.*)$ /index.php?q=$1 last;
>   break;
>   }
>   }
>
>   if ( $args ~ "mosConfig_[a-zA-Z_]{1,21}(=|\%3d)" ) {
>   set $args "";
>   rewrite ^.*$ http://$host/index.php last;
>   return 403;
>   }
>
>   if ( $args ~ "base64_encode.*\(.*\)" ) {
>   set $args "";
>   rewrite ^.*$ http://$host/index.php last;
>   return 403;
>   }
>
>   if ( $args ~ "(\<|%3C).*script.*(\>|%3E)" ) {
>   set $args "";
>   rewrite ^.*$ http://$host/index.php last;
>   return 403;
>   }
>
>   if ( $args ~ "GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ) {
>   set $args "";
>   rewrite ^.*$ http://$host/index.php last;
>   return 403;
>   }
>
>   if ( $args ~ "_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ) {
>   set $args "";
>   rewrite ^.*$ http://$host/index.php last;
>   return 403;
>   }
>
>
>
>   # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
>   location ~ \.php$
>   {
>   fastcgi_pass 127.0.0.1:9000;
>   fastcgi_index index.php;
>   include /usr/local/nginx/conf/fastcgi_params;
>   fastcgi_param SCRIPT_FILENAME
> /home/mydomain/public_html/$fastcgi_script_name;
>   }
>
>
>   ## All other errors get the generic error page
>   error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
> 416 417
>   500 501 502 503 504 505 /error_page.html;
>   location $document_root/error_page.html {
>   internal;
>
>   }
>
>   }
>
>
>
>



-- 
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org




      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090913/e1563192/attachment.html>


More information about the nginx mailing list