Files
ansible/inventory/group_vars/web_servers.yml
T
2026-11-09 11:29:04 -05:00

124 lines
3.3 KiB
YAML

---
### PHP config ###
php_install_composer: true
php_enable_php_fpm: true
php_webserver_daemon: "nginx"
# Ensure the socket directory and permissions allow Nginx access
php_fpm_pool_user: "nginx"
php_fpm_pool_group: "nginx"
php_fpm_listen_owner: "nginx"
php_fpm_listen_group: "nginx"
# Default Unix socket location on RHEL
php_fpm_listen: "/run/php-fpm/www.sock"
php_packages:
- php-cli
- php-common
- php-fpm
- php-gd
- php-ldap
- php-mbstring
- php-mysqlnd
- php-pdo
- php-pgsql
- php-xml
- php-pecl-zip
### Nginx config ###
nginx_vhosts:
# ----------------------------------------
# metaunix.net (Default Server)
# ----------------------------------------
- listen: "80 default_server"
server_name: "{{ ansible_fqdn }} metaunix.net www.metaunix.net www.int.metaunix.net"
root: "/nfs/web/www"
index: "index.html"
extra_parameters: |
location / {
try_files $uri $uri/ =404;
}
location ~ .well-known/acme-challenge/ {
root /nfs/web/acme;
try_files $uri =404;
}
# ----------------------------------------
# wiki.bitgoblin.tech (DokuWiki)
# ----------------------------------------
- listen: "80"
server_name: "wiki.bitgoblin.tech"
root: "/nfs/web/dokuwiki"
index: "index.php"
extra_parameters: |
location / {
index doku.php;
try_files $uri $uri/ @dokuwiki;
}
location @dokuwiki {
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
rewrite ^/(.*) /doku.php?id=$1 last;
}
location ~ ^/lib.*\.(gif|png|ico|jpg)$ {
expires 30d;
}
location ^~ /conf/ {
return 403;
}
location ^~ /data/ {
return 403;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:{{ php_fpm_listen }};
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
fastcgi_param SERVER_PORT 443;
fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto;
fastcgi_param HTTP_X_FORWARDED_SSL on;
fastcgi_param REDIRECT_STATUS 200;
}
location ~ .well-known/acme-challenge/ {
root /nfs/web/acme;
try_files $uri =404;
}
# ----------------------------------------
# yourls.bitgoblin.tech
# ----------------------------------------
- listen: "80"
server_name: "yourls.bitgoblin.tech u.bitgoblin.tech"
root: "/nfs/web/yourls"
index: "index.php"
extra_parameters: |
location / {
try_files $uri $uri/ /yourls-loader.php$is_args$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:{{ php_fpm_listen }};
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REDIRECT_STATUS 200;
}
location ~ .well-known/acme-challenge/ {
root /nfs/web/acme;
try_files $uri =404;
}