L’installation de Nginx “auto .dev” ne chargera pas WordPress correctement

En suivant ce guide ( http://blog.evan.pro/how-to-set-up-dynamic-virtual-hosts-for-web-development ), j’essaie de configurer une configuration localhost / nginx qui me permet pour exécuter facilement des environnements sans append une entrée individuelle pour chacun (à l’aide de Dnsmasq). Lorsque je lance nginx et que j’accède à l’un des sites par sitename.dev, les sites utilisant WordPress ne semblent pas s’exécuter. Je pense qu’il y a quelque chose qui me manque dans la configuration de nginx,

worker_processes 1; error_log /usr/local/etc/nginx/logs/error.log debug; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /usr/local/etc/nginx/logs/access.log main; sendfile on; keepalive_timeout 65; index index.html index.php; server { listen 80; server_name .dev; # dynamic vhosts for development set $basepath "/var/www"; set $domain $host; if ($domain ~ "^(.*)\.dev$") { set $domain $1; } set $rootpath "${domain}"; if (-d $basepath/$domain/public) { set $rootpath "${domain}/public"; } if (-d $basepath/$domain/httpdocs) { set $rootpath "${domain}/httpdocs"; } if (-d $basepath/$domain/web) { set $rootpath "${domain}/web"; } if (-f $basepath/$domain/index.php) { set $rootpath $domain; } if (-f $basepath/$domain/index.html) { set $rootpath $domain; } root $basepath/$rootpath; # enable PHP index index.php app.php index.html; location / { index index.php; error_page 404 = @indexphp; include /usr/local/etc/nginx/conf.d/php-fpm; try_files $uri $uri/ /index.php?$args; } location @indexphp { rewrite ^(.*)$ /index.php$1; } location ~ ^(.+\.php)(?:/.+)?$ { expires off; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; } # block .ht* access location ~ /\.ht { deny all; } } } 

Par exemple, accéder à mynewproject.dev me donne 200 OK mais rien n’est chargé. En accédant à someotherproject.dev qui n’utilise pas WordPress (mais utilise un langage de serveur comme PHP), je vois le site correctement affiché.

Chech le suivant

1) Si vous avez utilisé un wordpress dans un dossier, vous devez l’append à votre ensemble $ basepath “/ var / www”;

2) Publiez votre journal des erreurs.