{"id":13546924,"url":"https://github.com/spinupwp/wordpress-nginx","last_synced_at":"2025-12-29T22:31:04.565Z","repository":{"id":43055794,"uuid":"46117812","full_name":"spinupwp/wordpress-nginx","owner":"spinupwp","description":"Nginx server configurations for WordPress","archived":false,"fork":false,"pushed_at":"2024-06-27T19:19:29.000Z","size":61,"stargazers_count":609,"open_issues_count":17,"forks_count":181,"subscribers_count":50,"default_branch":"develop","last_synced_at":"2024-11-03T15:38:18.181Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"DIGITAL Command Language","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/spinupwp.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-13T11:19:54.000Z","updated_at":"2024-10-27T16:06:34.000Z","dependencies_parsed_at":"2024-01-16T17:39:30.839Z","dependency_job_id":"dfbbff00-a958-4721-8f9e-63a6e34e1e45","html_url":"https://github.com/spinupwp/wordpress-nginx","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/spinupwp%2Fwordpress-nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinupwp%2Fwordpress-nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinupwp%2Fwordpress-nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinupwp%2Fwordpress-nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spinupwp","download_url":"https://codeload.github.com/spinupwp/wordpress-nginx/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246880121,"owners_count":20848816,"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":[],"created_at":"2024-08-01T12:00:48.046Z","updated_at":"2025-12-29T22:31:04.560Z","avatar_url":"https://github.com/spinupwp.png","language":"DIGITAL Command Language","funding_links":[],"categories":["DIGITAL Command Language"],"sub_categories":[],"readme":"# WordPress Nginx\n\nThis config kit contains the Nginx configurations used in the [Install WordPress on Ubuntu 24.04](https://spinupwp.com/install-wordpress-ubuntu/) guide. It contains best practices from various sources, including the [WordPress Developer Resources](https://developer.wordpress.org/advanced-administration/server/web-server/nginx/) and [H5BP](https://github.com/h5bp/server-configs-nginx). The following example sites are included:\n\n* [multisite-subdirectory.com](sites-available/multisite-subdirectory.com) - WordPress multisite install using subdirectories\n* [multisite-subdomain.com](sites-available/multisite-subdomain.com) - WordPress multisite install using subdomains\n* [single-site.com](sites-available/single-site.com) - WordPress single site install\n* [single-site-with-caching.com](sites-available/single-site-with-caching.com) - WordPress single site install with FastCGI caching\n\n## Usage\n\n### Site configuration\n\nYou can use these sample configurations as reference or directly by replacing your existing nginx directory. Follow the steps below to replace your existing Nginx configuration.\n\nBackup any existing config:\n\n`sudo mv /etc/nginx /etc/nginx.backup`\n\nCopy these configs to `/etc/nginx`.\n\nSymlink the default file from _sites-available_ to _sites-enabled_, which will setup a catch-all server block. This will ensure unrecognised domains return a 444 response.\n\n`sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default`\n\nCopy one of the example configurations from _sites-available_ to _sites-available/yourdomain.com_:\n\n`sudo cp /etc/nginx/sites-available/single-site.com /etc/nginx/sites-available/yourdomain.com`\n\nEdit the site accordingly, paying close attention to the server name and paths.\n\nTo enable the site, symlink the configuration into the _sites-enabled_ directory:\n\n`sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/yourdomain.com`\n\nTest the configuration:\n\n`sudo nginx -t`\n\nIf the configuration passes, restart Nginx:\n\n`sudo systemctl reload nginx.service`\n\n### PHP configuration\n\nThe php-fpm pool configuration is located in `global/php-pool.conf` and defaults to PHP 8.3. It will need modifying if you want the default php-fpm pool service to be a different PHP version. Additional PHP version upstream definitions can be added to the `/upstreams` folder (a PHP 8.4 sample is provided there). You can either use the default pool using `$upstream` in your nginx configurations or the specific upstream definition (i.e. php84) setup by your custom upstream definitions.\n\nFor example, currently the nginx configuration for `single-site.com` has the following set for php requests:\n\n```\nfastcgi_pass    $upstream\n```\n\nYou could change that to the following to use the php 8.4 PHP service instead (assuming that php8.4-fpm service is running).\n\n```\nfastcgi_pass    php84\n```\n\nThis effectively allows you to have different server blocks execute different versions of PHP if needed.\n\n## Directory Structure\n\nThis config kit has the following structure, which is based on the conventions used by a default Nginx install on Debian:\n\n```\n.\n├── conf.d\n├── global\n    └── server\n├── sites-available\n├── sites-enabled\n```\n\n__conf.d__ - configurations for additional modules.\n\n__global__ - configurations within the `http` block.\n\n__global/server__ - configurations within the `server` block. The `defaults.conf` file should be included on the majority of sites, which contains sensible defaults for caching, file exclusions and security. Additional `.conf` files can be included as needed on a per-site basis.\n\n__sites-available__ - configurations for individual sites (virtual hosts).\n\n__sites-enabled__ - symlinks to configurations within the `sites-available` directory. Only sites which have been symlinked are loaded.\n\n### Recommended Site Structure\n\nThe following site structure is used throughout these configs:\n\n```\n.\n├── yourdomain1.com\n    └── cache\n    └── logs\n    └── public\n├── yourdomain2.com\n    └── cache\n    └── logs\n    └── public\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinupwp%2Fwordpress-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspinupwp%2Fwordpress-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinupwp%2Fwordpress-nginx/lists"}