bug fixes

This commit is contained in:
Joby 2024-10-22 20:32:46 -06:00
parent c94de8f2d7
commit 928e3ae04c
15 changed files with 45 additions and 17 deletions

0
install.sh Normal file → Executable file
View file

0
install/00-update-install.sh Normal file → Executable file
View file

0
install/01-nginx-default-root.sh Normal file → Executable file
View file

0
install/certbot.sh Normal file → Executable file
View file

0
install/fail2ban-nginx.sh Normal file → Executable file
View file

0
install/mysql.sh Normal file → Executable file
View file

0
install/nginx-conf.sh Normal file → Executable file
View file

View file

@ -1,6 +0,0 @@
# Turn on gzip compression
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;

View file

@ -1,10 +0,0 @@
# Basic PHP configuration
location ~ \.php$ {
limit_req zone=php burst=20 nodelay;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

32
install/nginx-snippets.sh Executable file
View file

@ -0,0 +1,32 @@
#!/bin/bash
# Check if script is run as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root or with sudo"
exit 1
fi
# Get the directory where this script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Define source and destination directories using absolute path
SRC_DIR="$SCRIPT_DIR/nginx-snippets"
DEST_DIR="/etc/nginx/snippets"
# Check if source directory exists
if [ ! -d "$SRC_DIR" ]; then
echo "Source directory '$SRC_DIR' not found"
exit 1
fi
# Create destination directory if it doesn't exist
mkdir -p "$DEST_DIR"
# Copy all .conf files
echo "Copying configuration files..."
cp -v "$SRC_DIR"/*.conf "$DEST_DIR/"
# Set proper permissions
echo "Setting permissions..."
chown root:root "$DEST_DIR"/*.conf
chmod 644 "$DEST_DIR"/*.conf

0
install/sshd_websftpusers.sh Normal file → Executable file
View file

0
install/swap.sh Normal file → Executable file
View file

0
install/unattended-upgrades.sh Normal file → Executable file
View file

View file

@ -12,9 +12,10 @@ server {
listen [::]:443 ssl http2;
server_name .$DOMAIN;
# SSL certificates
# SSL configuration
ssl_certificate /etc/letsencrypt/live/$DOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$DOMAIN/privkey.pem;
include snippets/ssl.conf;
# Apply general rate limit
limit_req zone=general burst=100 nodelay;
@ -72,6 +73,17 @@ server {
fastcgi_param SCRIPT_FILENAME $document_root/router.php;
}
# Basic PHP configuration
location ~ \.php$ {
limit_req zone=php burst=20 nodelay;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Static file handling
location ~* ^.+\.((?!php).)*$ {
expires 30d;