{"id":21340280,"url":"https://github.com/mnestorov/nginx-commands","last_synced_at":"2025-03-16T02:41:57.479Z","repository":{"id":111493931,"uuid":"454114733","full_name":"mnestorov/nginx-commands","owner":"mnestorov","description":"These list of Nginx commands should help you better understand and manage Nginx commands based on their functionality.","archived":false,"fork":false,"pushed_at":"2023-11-30T10:13:09.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T15:29:02.854Z","etag":null,"topics":["nginx","nginx-commands","nginx-config","nginx-configuration","nginx-server"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnestorov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-01-31T18:03:36.000Z","updated_at":"2023-11-30T14:00:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"96a9bdab-aafc-4ac2-9aef-9fabc940770c","html_url":"https://github.com/mnestorov/nginx-commands","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnestorov%2Fnginx-commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnestorov%2Fnginx-commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnestorov%2Fnginx-commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnestorov%2Fnginx-commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnestorov","download_url":"https://codeload.github.com/mnestorov/nginx-commands/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243817437,"owners_count":20352557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nginx","nginx-commands","nginx-config","nginx-configuration","nginx-server"],"created_at":"2024-11-22T00:49:56.177Z","updated_at":"2025-03-16T02:41:57.453Z","avatar_url":"https://github.com/mnestorov.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx Commands\n\n![Licence](https://img.shields.io/badge/Unlicense-red)\n\n## Overview\n\nThese list of Nginx commands should help you better understand and manage Nginx commands based on their functionality.\n\n## Starting and Stopping Nginx\n\n- [Start Nginx](#start-nginx)\n- [Stop Nginx](#stop-nginx)\n- [Restart Nginx](#restart-nginx)\n- [Reload Nginx](#reload-nginx)\n- [Quit Nginx](#quit-nginx)\n- [Check Nginx status](#check-nginx-status)\n\n## Configuration Management\n\n- [Reload Nginx configuration](#reload-nginx-configuration)\n- [Test Nginx configuration for syntax errors](#test-nginx-configuration-for-syntax-errors)\n- [Start Nginx with a custom configuration file](#start-nginx-with-a-custom-configuration-file)\n- [Start Nginx with a custom error log file](#start-nginx-with-a-custom-error-log-file)\n- [Start Nginx with a custom global configuration prefix](#start-nginx-with-a-custom-global-configuration-prefix)\n- [Set a custom worker process count](#set-a-custom-worker-process-count)\n\n## Logging and Monitoring\n\n- [View Nginx error logs](#view-nginx-error-logs)\n- [View Nginx access logs](#view-nginx-access-logs)\n- [Display active Nginx connections](#display-active-nginx-connections)\n\n## Process Management\n\n- [Display Nginx process ID (PID)](#display-nginx-process-id-pid)\n- [Send a signal to a specific Nginx process](#send-a-signal-to-a-specific-nginx-process)\n\n## Boot Configuration\n\n- [Enable Nginx auto-start at boot](#enable-nginx-auto-start-at-boot)\n- [Disable Nginx auto-start at boot](#disable-nginx-auto-start-at-boot)\n\n## Help and Version Information\n\n- [Display Nginx version and configuration options](#display-nginx-version-and-configuration-options)\n- [Display help information](#display-help-information)\n\n## Configuration File Management\n\n- [Create a temporary backup of the Nginx configuration](#create-a-temporary-backup-of-the-nginx-configuration)\n- [Restore a backup of the Nginx configuration](#restore-a-backup-of-the-nginx-configuration)\n- [Open the main Nginx configuration file with a text editor](#open-the-main-nginx-configuration-file-with-a-text-editor)\n- [Open a specific server block configuration file with a text editor](#open-a-specific-server-block-configuration-file-with-a-text-editor)\n- [Create a symbolic link to enable a server block](#create-a-symbolic-link-to-enable-a-server-block)\n- [Remove a symbolic link to disable a server block](#remove-a-symbolic-link-to-disable-a-server-block)\n\n---\n\n## Starting and Stopping Nginx\n\n### Start Nginx\n\n```\nsudo nginx\n```\n\n**For systemd (Ubuntu 16.04 LTS and above):**\n\n```\nsudo systemctl start nginx\n```\n\n### Stop Nginx\n\nStopping Nginx will kill all system processes quickly. This will terminate Nginx even if there are open connections. \nIn order to do so, run one of the following commands:\n\n```\nsudo nginx -s stop\n```\n\n**For systemd (Ubuntu 16.04 LTS and above):**\n\n```\nsudo systemctl stop nginx\n```\n\n### Restart Nginx\n\n```\nsudo service nginx restart\n```\n\n**For systemd (Ubuntu 16.04 LTS and above):**\n\n```\nsudo systemctl restart nginx\n```\n\n### Reload Nginx\n\n```\nsudo nginx -s reload\n```\n\n**For systemd (Ubuntu 16.04 LTS and above):**\n\n```\nsudo systemctl reload nginx\n```\n\n### Quit Nginx\n\n```\nsudo nginx -s quit\n```\n\n### Check Nginx status\n\n```\nsudo service nginx status\n```\n\n**For systemd (Ubuntu 16.04 LTS and above):**\n\n```\nsudo systemctl status nginx\n```\n\n## Configuration Management\n\n### Reload Nginx configuration\n\n```\nsudo nginx -s reload\n```\n\n**For systemd (Ubuntu 16.04 LTS and above):**\n\n```\nsudo systemctl reload nginx\n```\n\n### Test Nginx configuration for syntax errors\n\n```\nsudo nginx -t\n```\n\n### Start Nginx with a custom configuration file\n\n```\nsudo nginx -c /path/to/custom/nginx.conf\n```\n\n### Start Nginx with a custom error log file\n\n```\nsudo nginx -e /path/to/custom/error.log\n```\n\n### Start Nginx with a custom global configuration prefix\n\n```\nsudo nginx -p /path/to/custom/prefix\n```\n\n### Set a custom worker process count\n\n```\nsudo nginx -g \"worker_processes COUNT;\"\n```\n\n## Logging and Monitoring\n\n### View Nginx error logs\n\n```\nsudo tail -f /var/log/nginx/error.log\n```\n\n### View Nginx access logs\n\n```\nsudo tail -f /var/log/nginx/access.log\n```\n\n### Display active Nginx connections\n\n```\nsudo nginx -V 2\u003e\u00261 | grep -o with-http_stub_status_module\n```\n\n## Process Management\n\n### Display Nginx process ID (PID)\n\n```\nsudo cat /run/nginx.pid\n```\n\n### Send a signal to a specific Nginx process\n\n```\nsudo kill -s SIGNAL PID\n```\n\n## Boot Configuration\n\n### Enable Nginx auto-start at boot\n\n```\nsudo systemctl enable nginx\n```\n\n### Disable Nginx auto-start at boot\n\n```\nsudo systemctl disable nginx\n```\n\n## Help and Version Information\n\n### Display Nginx version and configuration options\n\n```\nnginx -V\n```\n\n### Display help information\n\n```\nnginx -h\n```\n\n## Configuration File Management\n\n### Create a temporary backup of the Nginx configuration\n\n```\nsudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backup\n```\n\n### Restore a backup of the Nginx configuration\n\n```\nsudo cp /etc/nginx/nginx.conf.backup /etc/nginx/nginx.conf\n```\n\n### Open the main Nginx configuration file with a text editor\n\n```\nsudo nano /etc/nginx/nginx.conf\n```\n\n### Open a specific server block configuration file with a text editor\n\n```\nsudo nano /etc/nginx/sites-available/your_server_block\n```\n\n### Create a symbolic link to enable a server block\n\n```\nsudo ln -s /etc/nginx/sites-available/your_server_block /etc/nginx/sites-enabled/\n```\n\n### Remove a symbolic link to disable a server block\n\n```\nsudo rm /etc/nginx/sites-enabled/your_server_block\n```\n\n---\n\n## License\n\nThis repository is unlicense[d], so feel free to fork.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnestorov%2Fnginx-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnestorov%2Fnginx-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnestorov%2Fnginx-commands/lists"}