Não é possível obter o nginx para renderizar meu site WordPress

0

Eu sou novo no nginx mas segui religiosamente todos os tutoriais e tentei configurar meu site WordPress, mas tenho um problema no momento em que não consigo resolver. Basicamente eu tenho a seguinte configuração no meu arquivo de configuração para o meu site wordpress:

server {
    listen 80;
    listen 443 default ssl;

    server_name domain.com;
    root /var/www/html/domain.com/htdocs;

    access_log /var/www/html/domain.com/htdocs/logs/access.log;
    error_log /var/www/html/domain.com/htdocs/logs/error.log;

    location / {
            index index.php index.html;
            try_files $uri $uri/ /index.php?$args;
    }

    rewrite /wp-admin$ $scheme://$host$uri/ permanent;

    location ~ /\. {
            access_log off;
            log_not_found off;
            deny all;
    }

    rewrite /files/$ /index.php last;

    if ($uri !~ wp-content/plugins) {
            rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
    }

    location ~* ^/(favicon.ico|robots.txt)$ {
            access_log off;
            log_not_found off;
    }

    location ~ .php$ {
            try_files $uri =404;

            # Include the fastcgi_params defaults provided by nginx
            include        /etc/nginx/fastcgi_params;

            # SCRIPT_FILENAME is a required parameter for things to work properly,
            # but is missing in the default fastcgi_params. We define it here to
            # be sure that it exists.
            #fastcgi_param   SCRIPT_FILENAME         $document_root$fastcgi_script_name;
            fastcgi_param SCRIPT_FILENAME /var/www/html/domain.com/htdocs$fastcgi_script_name;

                            # Use the upstream for fastcgi / php5-fpm that we defined in nginx.conf
            fastcgi_pass   php;

            # And get to serving the file!
            fastcgi_index  index.php;
    }

}

Quando eu digito o endereço IP / domain.com eu tenho um pouco de atraso e, em seguida, eu só pegar o texto do site. Nenhum erro e realmente é quase como a página não é processada. É porque o php não está sendo analisado corretamente? Caso contrário, alguma ideia sobre o que estou fazendo errado?

    
por Dimitris 23.09.2014 / 00:58

1 resposta

1

Parece que você não configurou o nginx para processar o PHP. Confira esta resposta.

    
por sмurf 23.09.2014 / 01:50