Automatic setup of a proxy server using Nginx Proxy Manager to protect your website servers.
- Connect to your server via SSH
- Download all project files
- Set executable permissions:
chmod +x *.sh- Start the full, secure installation:
sudo ./full-setup.sh- Connect to your server via SSH
- Download the install script:
wget https://raw.githubusercontent.com/your-repo/nginx-proxy-setup/main/setup-proxy-server.sh
chmod +x setup-proxy-server.sh- Run the setup:
sudo ./setup-proxy-server.sh- Installs the proxy server with secure passwords
- Sets up the firewall
- Creates a backup
- Checks system status
- Updates system packages
- Installs Docker and Docker Compose
- Generates secure passwords
- Starts and configures Docker service
- Creates the working directory
~/nginx-proxy-manager - Deploys Nginx Proxy Manager with MariaDB
- Checks container status
- Saves passwords to a secure file
- Displays web interface access info
After installation, open your browser and go to:
http://YOUR_SERVER_IP:81
Default credentials:
- Email:
admin@example.com - Password:
changeme
- Log in to the admin panel
- Go to
Hosts→Proxy Hosts→Add Proxy Host - Enter:
- Domain names: your domain
- Forward Hostname/IP: IP of your website server
- Forward Port: 443 (for HTTPS)
- Enable SSL: enabled
- On the SSL tab choose
Request a new SSL Certificate - Enable
Force SSL - Save changes
- Log in to your Cloudflare dashboard
- Go to the DNS section of your domain
- Update your A records:
@→ proxy server's IPwww→ proxy server's IP
- Wait for DNS updates to propagate (usually 1–5 minutes)
To check the status of the services, use:
sudo ./check-status.sh- Unified log of all operations:
/var/log/proxy-manager.log - Container logs:
docker logs nginx-proxy-manager_app_1
# Stop
cd ~/nginx-proxy-manager
docker-compose down
# Start
docker-compose up -d
# Restart
docker-compose restart
# Update images
docker-compose pull
docker-compose up -d- Change default passwords in
docker-compose.yml - Set up the firewall:
ufw allow 22
ufw allow 80
ufw allow 443
ufw allow 81
ufw enable- Regularly update Docker images
- Monitor logs for suspicious activity
nginx-proxy-manager/
├── setup-proxy-server.sh # Install script
├── check-status.sh # Status check script
├── update-passwords.sh # Update passwords
├── backup.sh # Backup/restore
├── setup-firewall.sh # Firewall setup
├── docker-compose.yml # Docker config
├── Makefile # Convenience commands
├── common.sh # Shared functions and config
├── seed/ # Batch proxy host import
│ ├── seed-proxy.sh # Domain import script
│ └── domains.txt # Domain list (domain ip format)
├── data/ # App data
│ └── mysql/ # MariaDB database
└── letsencrypt/ # SSL certificates
sudo ./update-passwords.shGenerates new secure passwords for all services.
# Create sample domains.txt file
sudo ./seed/seed-proxy.sh
# Edit domains.txt with your domains, then run:
make seedFormat (domains.txt):
# Format: domain ip
example1.com 192.168.1.100
example2.com 192.168.1.101
www.example1.com 192.168.1.100
# Create a backup
sudo ./backup.sh create
# List backups
sudo ./backup.sh list
# Restore from a backup
sudo ./backup.sh restore backup-name# Set up firewall with basic rules
sudo ./setup-firewall.sh setup
# Show firewall status
sudo ./setup-firewall.sh status
# Add a rule
sudo ./setup-firewall.sh add 8080 tcp "Custom port"
# Remove a rule
sudo ./setup-firewall.sh remove 1For easier management, use Make commands:
make install # Install proxy server
make status # Check status
make backup # Create a backup
make restore BACKUP_NAME=name # Restore
make update-passwords # Update passwords
make clean # Remove all data
make logs # View logs
make restart # Restart containers
make update # Update images
make test # Test setup
make help # Helpdocker-compose logs- Check your DNS records in Cloudflare
- Make sure your domain points to the proxy server
- Check logs:
docker logs nginx-proxy-manager_app_1
netstat -tuln | grep 81
ufw statusIf you have issues, check:
- The unified log:
/var/log/proxy-manager.log - Docker service status
- Port availability
- DNS settings in Cloudflare