Files
michaelschiemer/deployment/ansible/playbooks/fix-phpfpm-config.yml

37 lines
1.2 KiB
YAML

---
- name: Check and Fix PHP-FPM Configuration
hosts: production
gather_facts: yes
become: no
tasks:
- name: Check PHP-FPM www.conf configuration for allowed_clients
shell: |
cd ~/deployment/stacks/staging
echo "=== PHP-FPM www.conf listen.allowed_clients ==="
docker compose exec -T staging-app cat /usr/local/etc/php-fpm.d/www.conf 2>&1 | grep -E "(listen|allowed_clients|listen\.owner|listen\.group|listen\.mode)" | head -15
args:
executable: /bin/bash
register: fpm_config
ignore_errors: yes
failed_when: false
- name: Display PHP-FPM config
debug:
msg: "{{ fpm_config.stdout_lines }}"
- name: Check nginx error log for specific PHP-FPM errors
shell: |
cd ~/deployment/stacks/staging
echo "=== Nginx Error Log (all lines) ==="
docker compose logs --tail=200 staging-nginx 2>&1 | grep -iE "(502|bad gateway|upstream|php|fpm|connection)" || echo "No specific errors found"
args:
executable: /bin/bash
register: nginx_error_log
ignore_errors: yes
failed_when: false
- name: Display nginx error log
debug:
msg: "{{ nginx_error_log.stdout_lines }}"