36 lines
742 B
Markdown
36 lines
742 B
Markdown
---
|
|
created: 2025-11-11 16:24
|
|
updated: 2025-11-11 16:24
|
|
---
|
|
## Nginx
|
|
|
|
### Header Too Big
|
|
Add this to your PHP location block:
|
|
```bash
|
|
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
|
|
```apache
|
|
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.
|
|
```bash
|
|
sudo lsof -i -P -n | grep LISTEN
|
|
```
|
|
|
|
#Snippets #Nginx #Apache #Diagnostics
|