Nginx Management
Efficiently manage Nginx configurations, sites-available, and sites-enabled from a visual interface.
CtrlOps provides a comprehensive interface for managing Nginx web servers. It eliminates the need for manual symbolic linking and direct file editing via the terminal by providing a visual "Sites" manager and a built-in configuration editor.
Features Overview
- Status Monitoring: Real-time view of the Nginx service status (Active/Inactive).
- Site Management: Toggle sites between "Available" (
sites-available) and "Enabled" (sites-enabled). - Safe Editing: Integrated editor with configuration testing (
nginx -t) before reloading. - Service Control: Reload or Restart Nginx directly after applying changes.
Site Workflow
Nginx sites in CtrlOps follow the standard Debian/Ubuntu directory pattern.
1. Listing & Discovery
CtrlOps scans the following directories to populate the site list:
/etc/nginx/sites-available//etc/nginx/sites-enabled/
Sites appearing in both are marked as Enabled (Green). Sites only in available are marked as Disabled (Gray).
2. Enabling a Site
When you click "Enable", CtrlOps executes a symbolic link command:
ln -s /etc/nginx/sites-available/your-site /etc/nginx/sites-enabled/3. Disabling a Site
When you click "Disable", the symbolic link is removed:
rm /etc/nginx/sites-enabled/your-siteConfiguration Editor
The built-in editor provides a safe environment for modifying your site configs.
Modify the configuration file directly in the browser-based editor.
Before saving, CtrlOps allows you to run a dry-run test:
bash nginx -t
If the syntax is invalid, the error is displayed immediately, preventing server downtime.
Once validated, apply changes with a zero-downtime reload:
bash systemctl reload nginx
Recommended Configuration Template
For modern web applications, we recommend the following base configuration:
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# Standard logging
access_log /var/log/nginx/yourdomain.com.access.log;
error_log /var/log/nginx/yourdomain.com.error.log;
}Troubleshooting Nginx
Permission Denied: Ensure the user you are connecting with has sudo
privileges. CtrlOps automatically prepends sudo to Nginx management
commands.
Common checks:
- Port 80/443: Ensure they are open in your cloud provider's firewall.
- Syntax Errors: Always use the "Test Config" button if you manually edit lines.
- Logs: Check
journalctl -u nginxfor detailed service logs.
SSL Support: Want to secure this site? Head over to the Certbot SSL Guide to issue a free Let's Encrypt certificate.