Nginx Config - PasteText Optimized
23. Nginx Config - PasteText Optimized
=====================================
server {
listen 80;
server_name pastetext.com;
root /var/www/pastetext/public;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Cache static assets
location ~* \.(css|js|png|jpg|ico)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Rate limit pastes
limit_req_zone $binary_remote_addr zone=paste:10m rate=5r/m;
location /paste { limit_req zone=paste burst=10; }
}
Featured
Advertisement
Category
Action