An Ansible Role that installs Nginx from the distribution packages and configures a default site that hands PHP requests to php-fpm, specifically created with Phansible in mind.
- Ubuntu 22.04, 24.04, 26.04 or Debian 12, 13
- Ansible 2.15 or newer
- PHP requests are passed to
/run/php/php-fpm.sock, the socket the distro and sury php-fpm packages register for the installed PHP version. Install php-fpm separately, for example with role-php.
Available variables are listed below, along with default values (see defaults/main.yml):
nginx:
docroot: "/vagrant"
servername: "myApp.vb"nginx.docroot: document root of the default site.nginx.servername:server_nameof the default site.
None.
- hosts: all
become: yes
vars:
nginx:
docroot: /var/www/app/public
servername: app.test
roles:
- role-php
- role-nginxThis role is released under the terms of the license specified in the repository or if not specified, under the MIT license.
This role was created in 2015 by The Phansible Team & Contributors, credits go also to Jeff Geerling, author of Ansible for DevOps and source of inspiration.