#!/bin/bash #################################################################################################### #### author: SlickStack ############################################################################ #### link: https://slickstack.io ################################################################### #### mirror: http://mirrors.slickstack.io/bash/ss-install-nginx.txt ################################ #### path: /var/www/ss-install-nginx ############################################################### #### destination: n/a (not a boilerplate) ########################################################## #### purpose: Reinstalls the entire Nginx module for SlickStack servers (idempotent) ############### #### module version: Nginx 1.18.x ################################################################## #### sourced by: ss-install ######################################################################## #### bash aliases: ss install nginx ################################################################ #################################################################################################### ## SS-CONFIG MUST BE PROPERLY CONFIGURED AND ON CURRENT BUILD BEFORE RUNNING SS-INSTALL ## ## ENSURE YOUR SS-CONFIG BUILD REMAINS CURRENT BY RUNNING SS-UPDATE OCCASIONALLY ## ## include SlickStack configuration ## source /var/www/ss-config ## include SlickStack functions ## source /var/www/ss-functions #################################################################################################### #### SS-Install-Nginx: Message (Begin Script) ###################################################### #################################################################################################### ## this is a simple message that announces to the shell the purpose of this bash script ## ## it will only be noticed by sudo users who manually call ss core bash scripts ## ## echo message ## echo -e "${PURPLE}Running ss-install-nginx: Reinstalls the entire Nginx module for SlickStack servers (idempotent)... ${NOCOLOR}" sleep "$SLEEP_MESSAGE_BEGIN" #################################################################################################### #### SS-Install-Nginx: Backup Database Before Proceeding ########################################### #################################################################################################### ## run ss-dump-database ## source /var/www/ss-dump-database #################################################################################################### #### SS-Install-Nginx: Install Nginx Packages (Ubuntu) ############################################# #################################################################################################### ## run ss-install-nginx-core ## source /var/www/ss-install-nginx-core #################################################################################################### #### SS-Install-Nginx: Install Nginx Config Files ################################################## #################################################################################################### ## run ss-install-nginx-config ## source /var/www/ss-install-nginx-config #################################################################################################### #### SS-Install-Nginx: Touch Timestamp File (End Script) ########################################### #################################################################################################### ## this is a dummy timestamp file that will remember the last time this script was run ## ## it can be useful for developer reference and is sometimes used by SlickStack ## ## script timestamp ## touch /var/www/meta/.timestamp-ss-install-nginx #################################################################################################### #### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ############### #################################################################################################### ## Ref: https://serverfault.com/questions/527630/difference-in-sites-available-vs-sites-enabled-vs-conf-d-directories-nginx ## Ref: https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04 ## Ref: https://ar.al/2018/07/05/nginx-remember-to-remove-the-default-site/ ## Ref: https://discourse.roots.io/t/http-does-not-redirect-to-https-only-at-the-first-access/8669 ## SS_EOF