# 7.14 Static site troubleshooting

Source: https://ravindrabagale.com/mr/aws/ch07-static-website-hosting-3-oses-2-web-servers/7-14-troubleshooting-static-sites.html
Language: mr (Marathi with English technical terms)

एकावेळी एक check आणि एक बदल करा.

 | लक्षण | शक्य कारण | Check/fix

 | Timeout | SG/firewall, public IP/route/NACL | 80 rule, firewall status, IP/IGW route

 | Connection refused | Service बंद किंवा वेगळा port | service status; ss -tlnp

 | Default page | Host config match नाही | nginx -T; server_name; lab default link

 | 403 | Index नाही, permissions/labels/Require | ls -la; namei -l; 755/644; restorecon; logs

 | 404 | चुकीचा root/path/case | Index.html विरुद्ध index.html; config/log

 | CSS/images नाही | Relative path/file missing | DevTools Network tab

 | 502 | Proxy backend issue | Chapter 10; backend service/port/socket

 | बदल दिसत नाही | Reload नाही किंवा syntax error | nginx -t && service nginx reload

 | Stop/start नंतर बंद | Auto IP बदलला | EIP/DNS/server_name update

 | Address in use | Port 80 दुसरा process वापरतो | ss -tlnp; योग्य दुसरी lab service stop

मुख्य commands

curl -I http://localhost                      # does it work from inside the server?
sudo ss -tlnp | grep -E ':80|:443'            # who is listening?
sudo tail -n 30 /var/log/nginx/error.log      # Nginx errors
sudo tail -n 30 /var/log/httpd/error_log      # Apache errors (AL2023 / CentOS)
sudo tail -n 30 /var/log/apache2/error.log    # Apache errors (Ubuntu)
namei -l /var/www/mysite/index.html           # permissions of every folder in the path

Localhost चालतं पण बाहेर नाही तर network/SG/NACL/firewall/IP/HTTPS तसेच bind address आणि Host-based config तपासा. Loopback response एकटं बाहेरच्या interface चा access सिद्ध करत नाही.

Lab

फक्त disposable lab मध्ये HTTP 80 rule तात्पुरता काढून बाहेर timeout पाहा. Server वर curl -I localhost चालतो का तपासा. लगेच मूळ 80 rule परत करून browser test करा; SSH rule बदलू नका.

रवींद्र बागले यांची tip

तीन गोष्टी एकदम बदलल्या तर काय fix झालं कळत नाही. एक बदल, test, मग पुढचा बदल.
