{"id":29735679,"url":"https://github.com/iamntz/nginx-toolbox","last_synced_at":"2026-03-01T11:01:16.346Z","repository":{"id":45309886,"uuid":"82820361","full_name":"iamntz/nginx-toolbox","owner":"iamntz","description":"just some scripts to create sites","archived":false,"fork":false,"pushed_at":"2021-12-28T09:07:33.000Z","size":50,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-07T22:51:56.690Z","etag":null,"topics":["nginx","nginx-configuration","nginx-php-fpm","playground"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"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/iamntz.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}},"created_at":"2017-02-22T15:28:20.000Z","updated_at":"2022-01-12T16:44:09.000Z","dependencies_parsed_at":"2022-07-17T02:16:27.018Z","dependency_job_id":null,"html_url":"https://github.com/iamntz/nginx-toolbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iamntz/nginx-toolbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamntz%2Fnginx-toolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamntz%2Fnginx-toolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamntz%2Fnginx-toolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamntz%2Fnginx-toolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamntz","download_url":"https://codeload.github.com/iamntz/nginx-toolbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamntz%2Fnginx-toolbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29967930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T10:55:55.490Z","status":"ssl_error","status_checked_at":"2026-03-01T10:55:55.175Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-configuration","nginx-php-fpm","playground"],"created_at":"2025-07-25T13:45:13.480Z","updated_at":"2026-03-01T11:01:16.322Z","avatar_url":"https://github.com/iamntz.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Usage\n\n```\ncertbot certonly --dns-digitalocean --dns-digitalocean-credentials ~/.secrets/certbot/digitalocean.ini -d site.com -d *.site.com\n./create-site.sh site_user site_url\n```\n\n# To delete a site:\n\n```\nrm -rf /var/www/site_name/\nrm /etc/nginx/sites-available/site_name\nrm /etc/php/7.4/fpm/pool.d/user.conf\nrm -rf /etc/letsencrypt/live/site_name\nuserdel site_user\ngroupdel site_user\n```\n\n# First time Setup\n\n### Install requirements:\n\n```bash\nadd-apt-repository ppa:ondrej/php\nadd-apt-repository ppa:certbot/certbot\napt install sendmail imagemagick nginx composer phpunit mariadb-server redis-server\napt install php7.4-fpm php7.4-{bcmath,bz2,intl,gd,mbstring,mysql,zip,dom,curl,redis}\nsnap install core\nsnap refresh core\napt-get remove certbot\nsnap install --classic certbot\nsnap install certbot-dns-digitalocean\nln -s /snap/bin/certbot /usr/bin/certbot\n```\n\n### Make SSH allow connection from site_user\n\n```bash\necho \"AllowGroups sshusers\" \u003e\u003e /etc/ssh/sshd_config\naddgroup sshusers \u0026\u0026 adduser root sshusers\n```\n\n\n### Install WP-CLI\n\n```bash\ncurl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \u0026\u0026 chmod +x wp-cli.phar \u0026\u0026 mv wp-cli.phar /usr/local/bin/wp\n```\n\n### PHP tweaks\n\nSet CLI php version\n\n```\nupdate-alternatives --set php /usr/bin/php7.4\n```\n\nSecuring:\n```bash\necho \"cgi.fix_pathinfo=0\" \u003e\u003e /etc/php/7.4/fpm/php.ini\n```\n\nFix compat with large requests (e.g. ACF plugin): edit `/etc/php/7.4/fpm/php.ini` and change:\n```\nupload_max_filesize = 100M\npost_max_size = 100M\n```\n\nhttps://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04#configure-the-php-processor\n\n### Nginx tweaks\n\non `/etc/nginx/nginx.conf`  (http block)\n\n```\nclient_max_body_size 100m;\n```\n\n### Install Redis\n\nChange `supervised systemd` on /etc/redis/redis.conf\n\n```\nsystemctl restart redis.service\n```\n\nhttps://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-18-04\n\n\n### Certbot setup:\nCreate  `~/.secrets/certbot/digitalocean.ini`\n\n```\ndns_digitalocean_token = INSERT_TOKEN_HERE\n```\n\nYou find your token in DO sidebar -\u003e API -\u003e Personal Access Tokens\n\nCron job for certbot:\n\n```\n0 0 * * 1 certbot renew -q --dns-digitalocean --dns-digitalocean-credentials ~/.secrets/certbot/digitalocean.ini\n```\n\n`vim /etc/letsencrypt/renewal-hooks/deploy/01-reload-nginx` and add:\n\n```\n#! /bin/sh\nset -e\n\n/etc/init.d/nginx configtest\n/etc/init.d/nginx reload\n```\n\n`chmod +x /etc/letsencrypt/renewal-hooks/deploy/01-reload-nginx`\n\n### Logrotate:\n\nOn `/etc/logrotate.d/nginx`\n\n```\n/var/www/*/logs/*.log {\n    daily\n    missingok\n    rotate 14\n    compress\n    delaycompress\n    notifempty\n    create 0640 www-data adm\n    sharedscripts\n    prerotate\n        if [ -d /etc/logrotate.d/httpd-prerotate ]; then \\\n            run-parts /etc/logrotate.d/httpd-prerotate; \\\n        fi \\\n    endscript\n    postrotate\n        invoke-rc.d nginx rotate \u003e/dev/null 2\u003e\u00261\n    endscript\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamntz%2Fnginx-toolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamntz%2Fnginx-toolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamntz%2Fnginx-toolbox/lists"}