example.com is found, but not www.example.com

gariac nginx-forum at nginx.us
Sun May 17 23:32:17 UTC 2015


Well this looks so simple in the nginx manual. I have cleared the browser
cache. so I am running out of simple idea. The domain is inplanesight.org. 
http://www.inplanesight.org will 404
http://inplanesight.org works fine

Here is the server part of the nginx.conf file:
---------------------------------------------------------------
server {
        listen       80;
        server_name  inplanesight.org www.inplanesight.org;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;
         access_log /var/log/nginx/access.log;

         root   /usr/local/www/nginx;
        location / {
            try_files $uri $uri/ =404;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        location ~ \.php$ {
             try_files $uri =404;
             fastcgi_split_path_info ^(.+\.php)(/.+)$;
             fastcgi_pass unix:/var/run/php-fpm.sock;
             fastcgi_index index.php;
             fastcgi_param SCRIPT_FILENAME $request_filename;
             include fastcgi_params;
    }

        # pass the PHP scripts to FastCGI server listening on
127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

If it matters, I have two active server sections in the nginx.conf file.
This is the start of the second section:
-----------------------------------------------
server {
        listen       80;
        server_name  lazygranch.xyz  www.lazygranch.xyz;
-----------------------------------

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,258943,258943#msg-258943



More information about the nginx mailing list