Ansible nginx - ghdrako/doc_snipets GitHub Wiki
package_upgrade: true
packages:
- nginx
write_files:
- owner: www-data:www-data
path: /etc/nginx/sites-available/default
content: |
server {
listen 80 default_server;
root /var/www/site;
index index.html;
try_files $uri /index.html;
}
- owner: www-data:www-data
path: /var/www/site/index.html
content: |
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
<p>This is an example of a simple HTML page.</p>
</body>
</html>
runcmd:
- service nginx restart