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've just set up a simple LEMP stack on a fresh Ubuntu 12.04 install and I'm having some problems getting it working.

I want to be able to use phpMyAdmin at phpmyadmin.mydomain.com, and I've created this configuration file:

server {

        listen 80;
        server_name phpmyadmin.mydomain.com;

        root /usr/share/nginx/www/phpmyadmin.mydomain.com/web;
        index index.php;

        access_log /usr/share/nginx/www/phpmyadmin.mydomain.com/logs/access.log;
        error_log /usr/share/nginx/www/phpmyadmin.mydomain.com/logs/error.log;

        location / {
                try_files $uri $uri/;

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;

I've uploaded all the phpMyAdmin files to /usr/share/nginx/www/phpmyadmin.mydomain.com/web, however when I try to access it from phpmyadmin.mydomain.com I get a 403 Forbidden status code.

When I also try to access it from phpmyadmin.mydomain.com/index.php I get a 500 Internal Server Error. The log at /var/log/nginx/error.log says this about the 403's and 500's respectively:

*3 directory index of "/usr/share/nginx/www/" is forbidden
*3 rewrite or internal redirection cycle while internally redirecting to "/index.html"

I've already made www-data the owner of everything under /usr/share/nginx/www and recursively set the permissions for every file to 755.

Anyone know what might be going wrong?

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.