23 lines
544 B
Bash
Executable File
23 lines
544 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "Applying Nginx SSL configuration for OpenCode..."
|
|
|
|
# Copy new config to available sites
|
|
sudo cp /home/wartana/opencode/opencode.nginx /etc/nginx/sites-available/opencode
|
|
|
|
# Ensure link exists
|
|
if [ ! -L /etc/nginx/sites-enabled/opencode ]; then
|
|
sudo ln -s /etc/nginx/sites-available/opencode /etc/nginx/sites-enabled/
|
|
fi
|
|
|
|
# Test configuration
|
|
echo "Testing Nginx configuration..."
|
|
sudo nginx -t
|
|
|
|
# Reload Nginx
|
|
echo "Reloading Nginx..."
|
|
sudo systemctl reload nginx
|
|
|
|
echo "HTTPS configuration applied successfully!"
|