Nginx Config - PasteText Optimized

Text Views: 83 • Feb 08, 2026 • Never expires
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; }
}
🛡️

Ad Blocker Detected

PasteBin.site is free to use thanks to our sponsors. Please consider disabling your ad blocker or whitelisting our site to support our servers.

Learn More