Files
Obsidian-Vault/Work/Random/Web Server Snippets.md

742 B

created, updated
created updated
2025-11-11 16:24 2025-11-11 16:24

Nginx

Header Too Big

Add this to your PHP location block:

location ~ \.php$ {
    include fastcgi_params;
    # Increase buffer sizes to handle large headers
    fastcgi_buffers 16 16k;
    fastcgi_buffer_size 32k;
}

Apache

Block Bots / User Agents

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (Amazonbot|SemrushBot|meta-externalagent|Bytespider) [NC]
RewriteRule .* - [R=503,L]

Server Diagnostics

List All Listening Ports with Process Names

Useful for tracking multiple InertiaJS SSR servers or identifying which service is using which port.

sudo lsof -i -P -n | grep LISTEN

#Snippets #Nginx #Apache #Diagnostics