Skip to content

Instantly share code, notes, and snippets.

@orleika
Created February 9, 2017 07:00
Show Gist options
  • Save orleika/cb2b520f317f93d7ad5752d9ee86d357 to your computer and use it in GitHub Desktop.
Save orleika/cb2b520f317f93d7ad5752d9ee86d357 to your computer and use it in GitHub Desktop.
sudo sh -c 'echo "127.0.0.1 localhost test" >> /etc/hosts' && sudo sh -c 'echo "127.0.0.1 localhost test" >> /etc/hosts' && sudo apt-get update && sudo apt-get install nginx -y && sudo sh -c 'echo {\"status\": \"OK\"} > /var/www/html/check.json' && sudo sh -c 'cat << EOS > /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
location / {
try_files \$uri \$uri.json \$uri/ =404;
}
}
EOS
' && sudo service nginx start && sudo service nginx restart && curl -LI 127.0.0.1:80/ -o /dev/null -w '%{http_code}\n' -s && curl -i 127.0.0.1:80/check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment