chore: update staging branch with current changes

This commit is contained in:
2025-11-02 00:05:26 +01:00
parent 1f2ab358f9
commit 2defdf2baf
25 changed files with 1205 additions and 88 deletions

View File

@@ -0,0 +1,46 @@
---
- name: Test FastCGI Connection Directly
hosts: production
gather_facts: yes
become: no
tasks:
- name: Install cgi-fcgi in nginx container and test FastCGI
shell: |
cd ~/deployment/stacks/staging
echo "=== Test FastCGI with a simple request ==="
# Create a simple test script
docker compose exec -T staging-nginx sh -c "echo -e 'REQUEST_METHOD=GET\nSCRIPT_FILENAME=/var/www/html/public/index.php\nSERVER_NAME=test\n' > /tmp/fcgi-test.txt && cat /tmp/fcgi-test.txt" || echo "Could not create test file"
echo ""
echo "=== Check nginx error log directly ==="
docker compose exec -T staging-nginx tail -100 /var/log/nginx/error.log 2>&1 || echo "Error log not found at /var/log/nginx/error.log"
echo ""
echo "=== Check nginx access log ==="
docker compose exec -T staging-nginx tail -50 /var/log/nginx/access.log 2>&1 | tail -20 || echo "Access log not found"
args:
executable: /bin/bash
register: fcgi_test
ignore_errors: yes
failed_when: false
- name: Display FastCGI test results
debug:
msg: "{{ fcgi_test.stdout_lines }}"
- name: Make a real HTTP request and capture full response
shell: |
cd ~/deployment/stacks/staging
echo "=== Make HTTP request from nginx container ==="
docker compose exec -T staging-nginx curl -v http://127.0.0.1/ 2>&1 || echo "Request failed"
echo ""
echo "=== Check what nginx sees ==="
docker compose exec -T staging-nginx sh -c "timeout 2 tail -f /var/log/nginx/error.log 2>&1 & sleep 1 && curl -s http://127.0.0.1/ > /dev/null && sleep 1" || echo "Log check failed"
args:
executable: /bin/bash
register: http_test
ignore_errors: yes
failed_when: false
- name: Display HTTP test results
debug:
msg: "{{ http_test.stdout_lines }}"