Report this

What is the reason for this report?

Cent OS Host File

Posted on November 1, 2013

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?



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!

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.

Your hosts file is all jacked up. Although written for Ubuntu, check out <a href=https://github.com/DigitalOcean-User-Projects/Articles-and-Tutorials/blob/master/set_hostname_fqdn_on_ubuntu.md">Setting the Hostname & Fully Qualified Domain Name (FQDN) on Ubuntu 12.04</a> (the format of the hosts file should be the same).

It randomly started working, but I am now getting a bad gateway error(my guess is a PHP error)

Your hosts file is all jacked up. Although written for Ubuntu, check out <a href=“https://github.com/DigitalOcean-User-Projects/Articles-and-Tutorials/blob/master/set_hostname_fqdn_on_ubuntu.md”>Setting the Hostname & Fully Qualified Domain Name (FQDN) on Ubuntu 12.04</a> (the format of the hosts file should be the same).

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.