Update for multi-domain deployment alongside existing apps

This commit is contained in:
nmemmert committed 2025-11-06 10:06:30 -05:00
1 parent b51b5e8d29
commit 5814f76b28
2 files changed
+30 -23

No files matched your search

+17 -14
View File
@@ -67,12 +67,12 @@ sudo systemctl daemon-reload
sudo systemctl enable pdf-renamer
sudo systemctl start pdf-renamer
# Configure Nginx reverse proxy
echo "Configuring Nginx reverse proxy..."
# Configure Nginx reverse proxy for PDF Renamer (multi-domain setup)
echo "Configuring Nginx reverse proxy for PDF Renamer..."
sudo tee /etc/nginx/sites-available/pdf-renamer > /dev/null <<EOF
server {
listen 80;
server_name your-domain.com www.your-domain.com;
server_name pdf-renamer.your-domain.com; # Change this to your actual subdomain
# Handle large file uploads (500MB)
client_max_body_size 500M;
@@ -91,7 +91,7 @@ server {
add_header Cache-Control "public, immutable";
}
# Proxy to Flask app
# Proxy to Flask app on port 3000
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host \$host;
@@ -104,10 +104,10 @@ server {
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
# Timeout settings
# Timeout settings for large files
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
proxy_send_timeout 300s; # Increased for large uploads
proxy_read_timeout 300s; # Increased for large uploads
}
# Gzip compression
@@ -119,11 +119,11 @@ server {
}
EOF
# Enable the site
# Enable the PDF Renamer site (doesn't remove existing sites)
sudo ln -s /etc/nginx/sites-available/pdf-renamer /etc/nginx/sites-enabled/ 2>/dev/null || true
# Remove default nginx site if it exists
sudo rm -f /etc/nginx/sites-enabled/default
# Don't remove default nginx site - let existing apps continue working
# sudo rm -f /etc/nginx/sites-enabled/default
# Test nginx configuration
echo "Testing Nginx configuration..."
@@ -147,7 +147,7 @@ echo "1. Go to Azure Portal > Microsoft Entra ID > App registrations"
echo "2. Create a new registration or use existing one"
echo "3. Note the Application (client) ID and Directory (tenant) ID"
echo "4. Add a client secret under Certificates & secrets"
echo "5. Add redirect URI: https://your-domain.com/auth/microsoft/callback"
echo "5. Add redirect URI: https://pdf-renamer.your-domain.com/auth/microsoft/callback"
echo "6. Grant appropriate permissions if needed"
echo ""
echo "Next steps:"
@@ -158,11 +158,13 @@ echo " - CLIENT_ID: Your Microsoft Entra application ID"
echo " - CLIENT_SECRET: Your Microsoft Entra client secret"
echo " - ADMIN_USERNAME and ADMIN_PASSWORD: Set secure admin credentials"
echo ""
echo "2. Update the server_name in /etc/nginx/sites-available/pdf-renamer to your actual domain"
echo "2. Update the server_name in /etc/nginx/sites-available/pdf-renamer:"
echo " - Change 'pdf-renamer.your-domain.com' to your actual subdomain"
echo " - Point your DNS for this subdomain to this server's IP"
echo ""
echo "3. For SSL/HTTPS, install certbot:"
echo " sudo apt install certbot python3-certbot-nginx"
echo " sudo certbot --nginx -d your-domain.com"
echo " sudo certbot --nginx -d pdf-renamer.your-domain.com"
echo ""
echo "4. Reload systemd after updating environment variables:"
echo " sudo systemctl daemon-reload"
@@ -172,4 +174,5 @@ echo "5. Check service status:"
echo " sudo systemctl status pdf-renamer"
echo " sudo systemctl status nginx"
echo ""
echo "The application supports ZIP files up to 500MB and will be accessible at your domain name."
echo "NOTE: This setup runs alongside your existing app on port 5000."
echo "The PDF Renamer will be accessible at your subdomain on port 80/443."