vault backup: 2025-11-22 08:14:07
This commit is contained in:
35
Work/Random/Web Server Snippets.md
Normal file
35
Work/Random/Web Server Snippets.md
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
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
|
||||
Reference in New Issue
Block a user