Question

Cent OS Host File

Posted November 1, 2013 4.7k views
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?

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.

6 answers
Your hosts file is all jacked up. Although written for Ubuntu, check out Setting the Hostname & Fully Qualified Domain Name (FQDN) on Ubuntu 12.04 (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 Setting the Hostname & Fully Qualified Domain Name (FQDN) on Ubuntu 12.04 (the format of the hosts file should be the same).
It works though! I am getting transferred to my site!
What does this mean?
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"

*'s are my IP
Working!!! :D I guessed it and it worked! :)

Sorry for wasting anyone's time!
Submit an Answer