split php and nginx install into separate commands, new cache-control

nginx snippet.
This commit is contained in:
2020-03-08 14:20:54 +00:00
parent 49106d71ad
commit e90da400c7
2 changed files with 29 additions and 2 deletions
+7 -2
View File
@@ -55,8 +55,8 @@ function install_collection () {
echo "----- Install extra utilities: ncdu, zip, iftop -----"
install_collection 'extra utilities' ncdu zip unzip iftop
echo "----- Install nginx + php-fpm + certbot -------------"
install_collection 'nginx, php-fpm, certbot' nginx certbot python-certbot-nginx php-cli php-fpm php-curl php-gd php-imagick php-intl php-json php-mbstring php-mysql php-redis php-soap php-xml php-yaml php-zip
echo "----- Install nginx + certbot -----------------------"
install_collection 'nginx, certbot' nginx certbot python-certbot-nginx
echo "----- Add nginx logging conf ------------------------"
read -p 'Install the "tabbed_detailed" nginx log format? [y/N]: ' nginx_log
@@ -64,13 +64,18 @@ case $nginx_log in
[Yy]* )
LOCATION=`dirname "$0"`
mkdir -p "/etc/nginx/conf.d"
mkdir -p "/etc/nginx/snippets"
sudo cp "${LOCATION}/nginx/logging.conf" "/etc/nginx/conf.d/logging.conf"
sudo cp "${LOCATION}/nginx/cache-control.conf" "/etc/nginx/snippets/cache-control.conf"
;;
* )
echo 'Skipping'
;;
esac
echo "----- Install php-fpm -------------------------------"
install_collection 'php-fpm' php-cli php-fpm php-curl php-gd php-imagick php-intl php-json php-mbstring php-mysql php-redis php-soap php-xml php-yaml php-zip
echo "----- Install redis-server --------------------------"
install_collection 'redis-server' redis-server
+22
View File
@@ -0,0 +1,22 @@
# comment
# useful if you statically generate your website
#location ~* \.(html|pdf)$ {
# # cache documents for a day
# add_header Cache-Control "public, max-age=86400";
#}
location ~* \.(js|css|txt)$ {
# cache static-assets for a week
add_header Cache-Control "public, max-age=604800";
}
location ~* \.(png|jpg|jpeg|gif|ico|svg)$ {
# cache images for a month
add_header Cache-Control "public, max-age=2592000";
}
location ~* \.(ttf|otf|eot|woff|woff2)$ {
# cache fonts for a year
add_header Cache-Control "public, max-age=31536000";
}