Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save xerosanyam/4bb638ab49ee496e4290a24a0bf85ce4 to your computer and use it in GitHub Desktop.
Save xerosanyam/4bb638ab49ee496e4290a24a0bf85ce4 to your computer and use it in GitHub Desktop.
Settinp up nginx as Static File Server (Minimal)
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx
nginx -v
http://app.mindmapmaker.org/#m:mm494aabe32c8e4144829c631c0870a230
To start nginx (Linux)
sudo /etc/init.d/nginx start
To stop nginx (Linux)
sudo /etc/init.d/nginx stop
To reload nginx config (Linux)
sudo /etc/init.d/nginx reload
Location of sites (Linux)
/var/www/
To check to see if it is running
ps -ef | grep nginx
@xerosanyam
Copy link
Author

sudo apt-get install net-tools to install netstat & see netstat -plten

@xerosanyam
Copy link
Author

in cloud 9 change etc/nginx/sites-available/default to point to 8080 in place of 80
all other settings are intact.

@xerosanyam
Copy link
Author

To make files visible like filesystem

  1. vi /etc/nginx/sites-available/default
    location /{
    ... ( some other lines )
    autoindex on;
    ... ( some other lines )
    }
  2. cd /var/www/html/
    sudo chown ubuntu .
    rm *
    touch hw.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment