Some Issues with Configuration

Richard Ibbotson richard.ibbotson at
Mon Mar 10 21:53:53 UTC 2014


Thanks for some helpful answers so far.  I'm sure I'm neary there.  
Just need a bit more help.  I'm getting error 404 when I try to load a 
Wordpress page.  That's better than the previous attempt where NGINX 
was loading the PHP code from WP.  Some progress.  I can also load 
static HTML pages from my web server.  NGINX access.log and error.log 
are working.  The error.log says....

*1 open() "/usr/share/nginx/html/blog/index.php" failed (2: No such 
file or directory), 
 *1 open() "/usr/share/nginx/html/blog/index.php" failed (2: No such 
file or directory), 

I've done a search around the net for this error. I get some web pages 
that suggest removing the $uri/ in the nginx.conf file.  I've tried 
that but it doesn't work.  I was kind of hoping that someone out there 
might be able to suggest what to add to the nginx.conf file or what to 
take away.  There is nothing in conf.d other than fastcgi_params.conf.  
Nothing in sites-available or sites-enabled.  So far I've not run ' ln 
-s sites-available sites-enabled' .  So, mostly something to do with 
nginx.conf ? ............

user www-data;
pid /run/; 
worker_processes  4;

events {     
         worker_connections  1024;
         multi_accept on;

http {
        sendfile on;   
        tcp_nopush on; 
        tcp_nodelay on;
        keepalive_timeout 10 10; 
        types_hash_max_size 2048;
        client_max_body_size  20000k;
        client_header_timeout 10;
        client_body_timeout   10;
        send_timeout          10;
        index index.html index.htm index.php;
        upstream php {
                server unix:/tmp/php-fpm.sock;

server {
        server_name sleepypenguin;
        root /var/www/;

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        gzip  on;
        gzip_disable "msie6";

        gzip_vary on;
        gzip_proxied any;     
        gzip_comp_level 6;    
        gzip_buffers 16 8k;   
        gzip_http_version 1.1;
        gzip_types text/plain text/css application/json application/x-
javascript text/xml application/xml application/xml+rss 

  location = /favicon.ico {
                log_not_found off;
                access_log off;   

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;   

        location /var/www {
                try_files $uri /blog/index.php?$args;

        location ~ .php$ {
        root html;

        #location @wp {
        #rewrite ^/files(.*) /wp-includes/ms-files.php?file=$1 last;
        #root html;

                location ~ [^/]\.php(/|$) {
                fastcgi_split_path_info ^(blog.php)(/.*)$;
                if (!-f $document_root$fastcgi_script_name) {
                        return 404;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME 
        include fastcgi_params;

        rewrite ^(/[^/]+)?(/wp-.*) $2 last;
        rewrite ^(/[^/]+)?(/.*.php) $2 last;
        rewrite ^/(.*)$ /index.php?q=$1 last;

location ~* ^.+.(js|css|png|jpg|jpeg|gif|ico)$ {
        rewrite ^.*/files/(.*(js|css|png|jpg|jpeg|gif|ico))$ /wp-
includes/ms-files.php?file=$1 last;
        expires 24h;
        log_not_found off;
        rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;

       include /etc/nginx/conf.d/*.conf;
       include /etc/nginx/sites-enabled/*;



More information about the nginx mailing list