Initial commit - QBPOS Help
This commit is contained in:
62
config/nginx_setup.conf
Normal file
62
config/nginx_setup.conf
Normal file
@@ -0,0 +1,62 @@
|
||||
# Nginx Configuration for QuickBooks POS Help Documentation
|
||||
# For production deployment with 100,000+ users
|
||||
#
|
||||
# Installation:
|
||||
# 1. sudo apt install nginx
|
||||
# 2. sudo cp nginx_setup.conf /etc/nginx/sites-available/qbpos-help
|
||||
# 3. sudo ln -s /etc/nginx/sites-available/qbpos-help /etc/nginx/sites-enabled/
|
||||
# 4. sudo nginx -t
|
||||
# 5. sudo systemctl restart nginx
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name your-domain.com; # Change to your domain or IP
|
||||
|
||||
root /home/pts/Documents/QBPOS_Help_Web/QB_Help_Web;
|
||||
index POS_Help.html;
|
||||
|
||||
# Access and error logs (minimal logging)
|
||||
access_log /var/log/nginx/qbpos-access.log combined buffer=32k;
|
||||
error_log /var/log/nginx/qbpos-error.log warn;
|
||||
|
||||
# Gzip compression for text files
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 1024;
|
||||
gzip_types text/plain text/css text/xml text/javascript
|
||||
application/x-javascript application/xml+rss
|
||||
application/javascript application/json;
|
||||
|
||||
# Static asset caching (1 year for images, icons)
|
||||
location ~* \.(gif|jpg|jpeg|png|ico|css|js)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
access_log off; # Don't log static files
|
||||
}
|
||||
|
||||
# HTML files cache for 1 hour
|
||||
location ~* \.(html|htm)$ {
|
||||
expires 1h;
|
||||
add_header Cache-Control "public, must-revalidate";
|
||||
}
|
||||
|
||||
# Main location
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
# Security headers
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
|
||||
# Connection optimizations for high traffic
|
||||
keepalive_timeout 65;
|
||||
keepalive_requests 100;
|
||||
|
||||
# Rate limiting (optional - uncomment to limit requests)
|
||||
# limit_req_zone $binary_remote_addr zone=qbpos_limit:10m rate=10r/s;
|
||||
# limit_req zone=qbpos_limit burst=20 nodelay;
|
||||
}
|
||||
14
config/qbpos-health-check.service
Normal file
14
config/qbpos-health-check.service
Normal file
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=QBPOS Help Site Health Check
|
||||
After=network-online.target nginx.service
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/home/pts/Documents/QBPOS_Help_Web/health_check.sh
|
||||
User=root
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
11
config/qbpos-health-check.timer
Normal file
11
config/qbpos-health-check.timer
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Run QBPOS Help Health Check every 5 minutes
|
||||
Requires=qbpos-health-check.service
|
||||
|
||||
[Timer]
|
||||
OnBootSec=2min
|
||||
OnUnitActiveSec=5min
|
||||
Unit=qbpos-health-check.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
69
config/qbpos-help-final.conf
Normal file
69
config/qbpos-help-final.conf
Normal file
@@ -0,0 +1,69 @@
|
||||
# HTTPS Configuration for quickbookposhelp.access.ly
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
|
||||
server_name quickbookposhelp.access.ly;
|
||||
|
||||
# SSL Certificate
|
||||
ssl_certificate /etc/letsencrypt/live/quickbookposhelp.access.ly/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/quickbookposhelp.access.ly/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
# Document root
|
||||
root /home/pts/Documents/QBPOS_Help_Web/QB_Help_Web;
|
||||
index POS_Help.html;
|
||||
|
||||
# Access and error logs
|
||||
access_log /var/log/nginx/qbpos-access.log combined buffer=32k;
|
||||
error_log /var/log/nginx/qbpos-error.log warn;
|
||||
|
||||
# Gzip compression
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 1024;
|
||||
gzip_types text/plain text/css text/xml text/javascript
|
||||
application/x-javascript application/xml+rss
|
||||
application/javascript application/json;
|
||||
|
||||
# Static asset caching (images and icons)
|
||||
location ~* \.(gif|jpg|jpeg|png|ico)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# CSS and JS caching (shorter for updates)
|
||||
location ~* \.(css|js)$ {
|
||||
expires 1h;
|
||||
add_header Cache-Control "public, must-revalidate";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# HTML files cache
|
||||
location ~* \.(html|htm)$ {
|
||||
expires 1h;
|
||||
add_header Cache-Control "public, must-revalidate";
|
||||
}
|
||||
|
||||
# Main location - serves index automatically
|
||||
location / {
|
||||
try_files $uri $uri/ /POS_Help.html;
|
||||
}
|
||||
|
||||
# Certbot verification
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/html;
|
||||
}
|
||||
}
|
||||
|
||||
# HTTP to HTTPS redirect
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name quickbookposhelp.access.ly;
|
||||
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
50
config/qbpos-help-http-temp.conf
Normal file
50
config/qbpos-help-http-temp.conf
Normal file
@@ -0,0 +1,50 @@
|
||||
# Temporary HTTP-only configuration for quickbooksposhelp.access.ly
|
||||
# Used to obtain SSL certificate, then replaced with HTTPS config
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
listen 8888;
|
||||
listen [::]:8888;
|
||||
|
||||
server_name quickbookposhelp.access.ly;
|
||||
|
||||
# Document root
|
||||
root /home/pts/Documents/QBPOS_Help_Web/QB_Help_Web;
|
||||
index POS_Help.html;
|
||||
|
||||
# Access and error logs
|
||||
access_log /var/log/nginx/qbpos-access.log combined buffer=32k;
|
||||
error_log /var/log/nginx/qbpos-error.log warn;
|
||||
|
||||
# Gzip compression
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 1024;
|
||||
gzip_types text/plain text/css text/xml text/javascript
|
||||
application/x-javascript application/xml+rss
|
||||
application/javascript application/json;
|
||||
|
||||
# Static asset caching
|
||||
location ~* \.(gif|jpg|jpeg|png|ico|css|js)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# HTML files cache
|
||||
location ~* \.(html|htm)$ {
|
||||
expires 1h;
|
||||
add_header Cache-Control "public, must-revalidate";
|
||||
}
|
||||
|
||||
# Main location
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
# Allow certbot verification
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/html;
|
||||
}
|
||||
}
|
||||
81
config/qbpos-help-ssl.conf
Normal file
81
config/qbpos-help-ssl.conf
Normal file
@@ -0,0 +1,81 @@
|
||||
# Nginx Configuration for quickbooksposhelp.access.ly
|
||||
# With SSL/HTTPS support
|
||||
|
||||
# Redirect HTTP to HTTPS
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name quickbookposhelp.access.ly;
|
||||
|
||||
# Redirect all HTTP requests to HTTPS
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
# HTTPS Server
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
|
||||
server_name quickbookposhelp.access.ly;
|
||||
|
||||
# SSL Certificate paths (will be updated by certbot)
|
||||
ssl_certificate /etc/letsencrypt/live/quickbookposhelp.access.ly/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/quickbookposhelp.access.ly/privkey.pem;
|
||||
|
||||
# SSL Configuration - Modern and Secure
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384';
|
||||
ssl_prefer_server_ciphers off;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
|
||||
# Document root
|
||||
root /home/pts/Documents/QBPOS_Help_Web/QB_Help_Web;
|
||||
index POS_Help.html;
|
||||
|
||||
# Access and error logs
|
||||
access_log /var/log/nginx/qbpos-access.log combined buffer=32k;
|
||||
error_log /var/log/nginx/qbpos-error.log warn;
|
||||
|
||||
# Gzip compression
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 1024;
|
||||
gzip_types text/plain text/css text/xml text/javascript
|
||||
application/x-javascript application/xml+rss
|
||||
application/javascript application/json text/html;
|
||||
|
||||
# Static asset caching (1 year for images, icons)
|
||||
location ~* \.(gif|jpg|jpeg|png|ico|css|js)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# HTML files cache for 1 hour
|
||||
location ~* \.(html|htm)$ {
|
||||
expires 1h;
|
||||
add_header Cache-Control "public, must-revalidate";
|
||||
}
|
||||
|
||||
# Main location
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
# Security headers
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
||||
|
||||
# Deny access to hidden files
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
access_log off;
|
||||
log_not_found off;
|
||||
}
|
||||
}
|
||||
25
config/qbpos-help.service
Normal file
25
config/qbpos-help.service
Normal file
@@ -0,0 +1,25 @@
|
||||
[Unit]
|
||||
Description=QuickBooks POS Help Documentation Server
|
||||
After=network.target
|
||||
StartLimitIntervalSec=0
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=pts
|
||||
Group=pts
|
||||
WorkingDirectory=/home/pts/Documents/QBPOS_Help_Web
|
||||
ExecStart=/usr/bin/python3 /home/pts/Documents/QBPOS_Help_Web/secure_production_server.py
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
# Security settings
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
|
||||
# Logging
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=qbpos-help
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user