Created
June 27, 2017 14:20
-
-
Save 64lines/ca7d98542f4a51184dd41bfc4687822b to your computer and use it in GitHub Desktop.
[BASH] Nginx install and configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo "*** Installing nginx packages... ***" | |
| apt-get install -y nginx-core | |
| mkdir /var/www/ | |
| echo "*** Setting stuff up... ***" | |
| STATIC_NGINX_CONF="/etc/nginx/conf.d/static.conf" | |
| echo "<h1>This is a static content server with nginx</h1>" >> /var/www/index.html | |
| echo "server {" > $STATIC_NGINX_CONF | |
| echo " listen 80;" >> $STATIC_NGINX_CONF | |
| echo " location / {" >> $STATIC_NGINX_CONF | |
| echo " root /var/www/;" >> $STATIC_NGINX_CONF | |
| echo " index index.html;" >> $STATIC_NGINX_CONF | |
| echo " }" >> $STATIC_NGINX_CONF | |
| echo "}" >> $STATIC_NGINX_CONF | |
| rm /etc/nginx/sites-enabled/default | |
| nginx -s reload | |
| echo "cd /cookbooks" >> .bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment