cannot access my website after updaing the nginx config file and doing OS updates

Posted February 11, 2015 4.9k views

I am a total beginner with servers administration and Ubuntu.
I am using Cloud66 to manage my digital ocean droplet.
My website was opening normally today, then I have done three actions, which lead to my site not opening anymore on browsers with the below error:

The requested URL could not be retrieved
While trying to retrieve the URL:
The following error was encountered:
Connection to Failed
The system returned:
    (111) Connection refused
The remote host or network may be down. Please try the request again.
Your cache administrator is webmaster. 
Generated Wed, 11 Feb 2015 22:59:11 GMT by (squid/2.7.STABLE6)

These are the three action I have taken today:
1- Added some lines to my nginx config file through cloud66 interface
after the change I checked still issues. (But I am not sure when the change of the config file takes affect? )
below are the lines I have added, please note that I have no experience but was trying to enable caching for my site..and found this code from a solution on the Internet.

location ~ ^/(assets)/  {
  root /path/to/site;
  gzip_static on;
  expires max;
  add_header Cache-Control public;
  # access_log /dev/null;

2- Accessed my droplet through digital ocean console and run update sudo apt-get update and sudo apt-get upgrade
3- Rebooted through the same Digital Ocean console using the command sudo reboot.

After the reboot the site is no longer accessible. What may be the reason??

1 comment
  • Update at the end could cause a config file to be changed by a default one, look on /etc/nginx/ for the config file and open it, see if it is the same you edited before the update, most times the old file is named something like nginx.conf.rpm .old .bak, etc.

    I don’t use ubuntu so not sure about the specifics.

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.

Submit an Answer
1 answer

Problem solved. It was in the code nginx.conf
public should have been in quotations.