checknginx
Test the Nginx configuration and remove the virtual host of any domain whose Let's Encrypt certificate is missing, then rebuild the configuration
- Command:
/go/checknginx - Category: Web server
- Required option: None
- Output:
Deleting <domain> Configurationfor each virtual host removed - Last updated: 2026-11-20
On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also
Overview
Nginx refuses to start or reload when a virtual host points to an SSL certificate file that does not exist. /go/checknginx repairs this situation. It:
- runs the Nginx configuration test
- finds the domains named in errors about Let's Encrypt certificate paths
- deletes the virtual host file of each of those hosted domains
- rebuilds the web server configuration with
conf
It works only on servers that run Nginx. On an Apache server it does nothing; use checkapache there.
Quick start
/go/checknginx
Syntax
/go/checknginx
The command takes no options or arguments. Run it as root.
Options
None. Any arguments you pass are ignored.
Output
The command prints one line for each virtual host it removes:
Deleting example.com Configuration
It prints nothing when the test finds no matching error, or when the server does not run Nginx. The result of the Nginx test itself is not shown. It is saved in /usr/local/goadmio/tmp/checknginx.db.
Each run also adds a line to /var/log/go/checknginx.log.
Examples
# Check and repair
/go/checknginx
# Read the result of the Nginx test that the command saved
cat /usr/local/goadmio/tmp/checknginx.db
# Confirm that Nginx is healthy afterwards
nginx -t
# Install a new certificate for a domain whose configuration was removed
/go/ssl example.com
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Nothing is printed, but Nginx still fails | The error does not mention a Let's Encrypt certificate path, or the domain has no /home/<domain>/www folder. |
Run nginx -t and fix the error shown. |
| Nothing is printed on an Apache server | The command only works with Nginx. | Use checkapache. |
| Nothing is printed, although the server runs Nginx | The web server name saved in /usr/local/goadmio/linux/ws.db is not exactly NGINX in capital letters. |
Check the value in that file. |
| A domain is not served over HTTPS after the command | Its virtual host was deleted because the certificate was missing, and the rebuilt one has no valid certificate yet. | Install a certificate again with ssl or installssl. |
| The same domain is removed every time | The certificate keeps going missing, for example because renewal fails. | Check the domain's DNS and renew the certificate with ssl. |
| The test file cannot be written | The command was run without root. | Run it as root. |
Details
What it does, in order
- Logs the run to
/var/log/go/checknginx.log. - Reads the web server name from
/usr/local/goadmio/linux/ws.db. If it is notNGINX, the command stops here. - Runs
nginx -tand saves its output to/usr/local/goadmio/tmp/checknginx.db. - Extracts every name that follows
/live/in that output, which is the domain folder inside the Let's Encrypt certificate path, and saves the list in/usr/local/goadmio/tmp/nginx.db. - For each name in the list that is a hosted domain (
/home/<domain>/wwwexists), printsDeleting <domain> Configurationand deletes the file/etc/nginx/vbost/<domain>.conf. - If anything was deleted, rebuilds the configuration with
conf.
Which errors it handles
Only errors whose text contains a Let's Encrypt path such as /etc/letsencrypt/live/example.com/... are handled, typically a certificate or key file that does not exist or cannot be loaded. Other configuration errors are saved in the test file but are not fixed.
Difference from checkapache
checknginx |
checkapache |
|
|---|---|---|
| Web server | Nginx | Apache |
| File deleted | The whole virtual host file of the domain | Only the SSL virtual host file of the domain |
Known issues
- The command removes only domains that have a site folder. A virtual host with no site folder is left alone, even though the command is sometimes described as removing those.
- Any line of the test output with
/live/<name>leads to a deletion, including warnings, as long as<name>is a hosted domain. - The command does not request a new certificate.
- The server IP, host name, and operating system are read at the start but not used.
See also
| Command | Description |
|---|---|
checkapache |
Validate the Apache configuration |
conf |
Rebuild the Apache/Nginx configuration in GoAdmio |
nginx |
Convert a GoAdmio server from Apache to Nginx |
ssl |
Install an SSL certificate for a domain in GoAdmio |
checkssl |
Check if SSL certificates are installed for all domains |
reload |
Reload PHP-FPM and the active web server |