Question

Cent OS Host File

Any idea why this setup doesn’t work? I think it’s the host file: NGINX VIRTUAL.CONF

server_names_hash_bucket_size 64; server {

listen 80; 

server_name 162.243.133.133;

rewrite ^(.*) http://www.samuelcdn.co.uk$1 permanent;

}

server { listen 80;

server_name lesamportfolio.com www.lesamportfolio.com;

root /var/www/html/lesamportfolio.com;
index index.html index.php;

location / {
    try_files $uri $uri/ @extensionless-php;
}

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

	location @extensionless-php {
		rewrite ^(.*)$ $1.php last;
	}
location ~/\. {
	deny all;
}

}

server { listen 80;

server_name www.pingrglobe.com pingrglobe.com;
rewrite ^(.*) https://www.pingrglobe.com$1 permanent;

}

server { listen 443; ssl on; ssl_certificate /etc/nginx/conf.d/pingrglobe.crt; ssl_certificate_key /etc/nginx/conf.d/pingrglobe.key;

server_name pingrglobe.com;
rewrite ^(.*) https://www.pingrglobe.com$1 permanent;

}

server { listen 443; ssl on; ssl_certificate /etc/nginx/conf.d/pingrglobe.crt; ssl_certificate_key /etc/nginx/conf.d/pingrglobe.key; server_name www.pingrglobe.com;

root /var/www/html/pingrglobe.com;
index index.html index.php;

location / {
    try_files $uri $uri/ @extensionless-php;
    add_header Access-Control-Allow-Origin *;
}
rewrite ^/blog/blogpost/(.+)$ /blog/blogpost?post=$1 last;  
rewrite ^/viewticket/(.+)/(.*)$ /viewticket?tid=$1&$2 last;
rewrite ^/vemail/(.+)$ /vemail?eid=$1 last;
rewrite ^/serversettings/(.+)$ /serversettings?srvid=$1 last;
rewrite ^/notification/(.+)$ /notification?id=$1 last;
rewrite ^/viewreport/(.+)$ /viewreport?srvid=$1 last;
rewrite ^/removeserver/(.+)$ /removeserver?srvid=$1 last;
rewrite ^/staffviewticket/(.+)/(.*)$ /staffviewticket?tid=$1&$2 last;
rewrite ^/activate/(.*)/(.*)/(.*)$ /activate?user=$1&code=$2&email=$3 last;
rewrite ^/activate2/(.*)/(.*)/(.*)$ /activate2?user=$1&code=$2&email=$3 last;
rewrite ^/passwordtoken/(.+)/(.*)/(.*)$ /passwordtoken?user=$1&token=$2&email=$3 last;
location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

	location @extensionless-php {
		rewrite ^(.*)$ $1.php last;
	}

location ~ /\. {
    deny all;
	}

}

server { listen 80;

server_name samuelcdn.co.uk www.samuelcdn.co.uk;

root /var/www/html/samuelcdn.co.uk;
index index.html index.php;

location / {
    try_files $uri $uri/ @extensionless-php;
}

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

	location @extensionless-php {
		rewrite ^(.*)$ $1.php last;
	}

location ~ /\. {
    deny all;
	}

}


CENT OS /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

162.243.140.58 pingrglobe.com www.pingrglobe.com samuelcdn.co.uk www.samuelcdn.co.uk lesamportfolio.com www.lesamportfolio.com

Why does pingrglobe.com not load?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Working!!! :D I guessed it and it worked! :) <br> <br>Sorry for wasting anyone’s time!

What does this mean? <br>2013/11/01 19:40:25 [crit] 1199#0: 34 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: ..., server: www.pingrglobe.com, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock:”, host: “www.pingrglobe.com” <br> <br>'s are my IP

It works though! I am getting transferred to my site!