Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user www www;
- worker_processes 1;
- error_log /var/log/nginx/error.log;
- pid /var/run/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- server_tokens off;
- # server_name_in_redirect off;
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
- sendfile on;
- tcp_nopush on;
- keepalive_timeout 10 5;
- # client_body_buffer_size 8k;
- # client_header_buffer_size 1k;
- # client_max_body_size 1;
- # large_client_header_buffers 1 1k;
- # client_body_timeout 5;
- # client_header_timeout 5;
- ignore_invalid_headers on;
- # limit_zone gulag $binary_remote_addr 1m;
- # recursive_error_pages on;
- gzip on;
- server {
- listen 80;
- server_name foobar.dyndns.org;
- charset utf-8;
- access_log /var/log/nginx/foobar.access.log main;
- log_not_found off;
- location / {
- root /usr/local/www/nginx;
- index index.php index.html;
- error_page 404 /404.html;
- error_page 500 502 503 504 /50x.hmtl;
- }
- location /blog/ {
- try_files $uri $uri/ /index.php?q=$uri&$args;
- }
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- location ~ \.php$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /usr/local/www/nginx$fastcgi_script_name;
- include fastcgi_params;
- }
- # location /blog/ {
- # try_files $uri $uri/ /index.php?q=$uri&$args;
- # }
- # location /blog/ {
- # if (!-e $request_filename) {
- # rewrite ^.*$ /index.php last;
- # }
- # }
- location ~ /\.ht {
- deny all;
- }
- ## Only allow GET and HEAD and POST request methods
- if ($request_method !~ ^(GET|HEAD|POST)$ ) {
- return 444;
- }
- ## Deny certain Referers (case insensitive)
- ## The ~* makes it case insensitive as opposed to just a ~
- if ($http_referer ~* (babes|click|diamond|forsale|girl|jewelry|love|nudit|organic|poker|porn|poweroversoftware|sex|teen|video|webcam|zippo) ) {
- return 444;
- }
- }
- }
Add Comment
Please, Sign In to add comment