Nginx kann meine WordPress-Site nicht rendern

Nginx kann meine WordPress-Site nicht rendern

Ich bin neu bei nginx, habe aber alle Tutorials gewissenhaft befolgt und versucht, meine WordPress-Site einzurichten, aber im Moment habe ich ein Problem, das ich nicht lösen kann. Im Wesentlichen habe ich die folgende Konfiguration in meiner Konfigurationsdatei für meine WordPress-Site:

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;
    }

}

Wenn ich die IP-Adresse/Domain.com eingebe, kommt es etwas verzögert und dann bekomme ich nur den Text der Site. Keine Fehler und es ist wirklich fast so, als ob die Seite nicht gerendert wird. Liegt das daran, dass PHP nicht richtig analysiert wird? Sonst irgendwelche Ideen, was ich falsch mache?

Antwort1

Es sieht so aus, als ob Sie nginx nicht für die Verarbeitung von PHP konfiguriert haben. Schauen Sie sichDasAntwort.

verwandte Informationen