"Primary script unknown" wp-login.php

nano nanotek at bsdbox.co
Thu Jan 9 04:57:43 UTC 2014

As subject says: I cannot access wp-admin due to above [error]. 
Otherwise, site functions as it should.

See error log:
2014/01/09 04:31:23 [error] 35759#0: *5254 FastCGI sent in stderr: 
"Primary script unknown" while reading response header from upstream, 
client: ipaddress, server: hostname, request: "GET 
/wordpress/wp-login.php HTTP/1.1", upstream: 
"fastcgi://unix:/var/run/php-fpm.sock:", host: "hostname", referrer: 

See access.log
[09/Jan/2014:04:31:23 +0000] "GET /wordpress/wp-login.php HTTP/1.1" 404 
27 "hostname" "useragent" "-"

See nginx.conf
user  www;
worker_processes  1;
error_log  logs/error.log  info;
pid /var/run/nginx.pid;

events {
     worker_connections  768;

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  logs/access.log  main;
     sendfile        on;
     tcp_nopush     off;
     keepalive_timeout  65;
     gzip  off;

     server {
         listen       80;
         listen       443 ssl;
         server_name  hostname;
         root   /usr/local/www;
         ssl_certificate /path/to/crt-chain.pem;
         ssl_certificate_key /path/to/privatekey.pem;
         ssl_dhparam /pth/to/dhparam4096.pem;
         server_name hostname www.hostnam;
         ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	ssl_prefer_server_ciphers on;
         access_log  logs/access.log  main;
         charset utf-8;

         location / {
             root   /usr/local/www/wordpress;
             try_files $uri $uri/ /index.php?q=$uri&$args;
             index  index.php index.html index.htm;

         error_page   500 502 503 504  /50x.html;
         location = /50x.html {
             root   /usr/local/www/nginx-dist;

         location ~ \.(js|css|png|jpg|jpeg|gif|ico|html)$ {
             expires max;

         location ~ \.php$ {
             root html;
             fastcgi_pass unix:/var/run/php-fpm.sock;
             fastcgi_index  index.php;
             fastcgi_param  SCRIPT_FILENAME 
             include        fastcgi_params;

         location ~ /\.ht {
             deny  all;

See fastcgi_params:
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;
fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  HTTPS              $https if_not_empty;
fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;
fastcgi_param  REDIRECT_STATUS    200;

Please advise my mistake and how to fix. Thank you.

More information about the nginx mailing list