Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user www-data;
- timer_resolution 25ms;
- worker_priority -10;
- worker_processes auto;
- worker_rlimit_nofile 65536;
- #worker_rlimit_sigpending 32768;
- pid /var/run/nginx.pid;
- events {
- worker_connections 8192;
- use epoll;
- }
- http {
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- # access_log off;
- access_log /var/log/nginx/access.log combined gzip buffer=512k flush=1m;
- error_log /var/log/nginx/error.log error;
- log_not_found off;
- client_header_timeout 15;
- client_body_timeout 30;
- client_max_body_size 20m; #для закачки файлов!
- client_header_buffer_size 16k; #для того чтобы куки работали
- large_client_header_buffers 8 64k;
- send_timeout 10;
- output_buffers 4 128k;
- keepalive_timeout 30;
- keepalive_requests 1000;
- server_tokens off;
- recursive_error_pages on;
- gzip on;
- gzip_vary on;
- gzip_proxied any;
- gzip_min_length 1024;
- gzip_comp_level 4;
- gzip_types text/css text/xml text/plain text/javascript application/x-javascript application/atom+xml;
- sendfile on;
- sendfile_max_chunk 512k;
- directio 4m;
- aio threads;
- tcp_nopush on;
- tcp_nodelay on;
- reset_timedout_connection on;
- index index.php;
- open_file_cache max=8192 inactive=600s;
- open_file_cache_valid 600s;
- open_file_cache_min_uses 3;
- open_file_cache_errors on;
- client_body_temp_path /var/lib/nginx/body;
- proxy_temp_path /var/lib/nginx/proxy;
- fastcgi_temp_path /var/lib/nginx/fastcgi;
- set_real_ip_from 1.2.3.4/32;
- real_ip_header X-Real-IP;
- server {
- listen 80 default_server fastopen=256 backlog=1024 sndbuf=512k deferred;
- server_name forum.coolsite.ru;
- root /var/www/vhosts/forum.coolsite.ru/httpdocs;
- index index.php;
- fastcgi_index index.php;
- ## отвечаем только на те запросы, которые идут непосредственно на именной сервер (не по айпи)
- if ($host !~ ^(forum.coolsite.ru)$ ) {
- return 404;
- }
- location / {
- rewrite ^/forums/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;
- }
- location ~ \.html$ {
- # чтобы работал архив
- rewrite ^/archive/index.php/t-([0-9]+)-p-([0-9]+)\.html /archive/index.php?t-$1-p-$2.html last;
- rewrite ^/archive/index.php/f-([0-9]+)-p-([0-9]+)\.html /archive/index.php?f-$1-p-$2.html last;
- rewrite ^/archive/index.php/t-([0-9]+)\.html /archive/index.php?t-$1.html last;
- rewrite ^/archive/index.php/f-([0-9]+)\.html /archive/index.php?f-$1.html last;
- #для поддержки урлов, которые были сохранены при работе vbseo
- rewrite ^\/([0-9]+)-post([0-9]+)\.html$ /showpost.php?p=$1 permanent;
- rewrite ^\/(.*)\/([0-9]+)-(.*)-([0-9]+)\.html$ /showthread.php?t=$2&page=$4 permanent;
- rewrite ^\/(.*)\/([0-9]+)-(.*)\.html$ /showthread.php?t=$2 permanent;
- }
- location ~ \.php$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_param SCRIPT_FILENAME /var/www/vhosts/forum.coolsite.ru/httpdocs$fastcgi_script_name;
- include /etc/nginx/fastcgi_params;
- #отключаем выполнение скриптов в некоторых каталогах
- rewrite ^\/albums\/(.*)\.php$ /null.php last;
- rewrite ^\/clientscript\/(.*)\.php$ /null.php last;
- rewrite ^\/customattachments\/(.*)\.php$ /null.php last;
- rewrite ^\/customavatars\/(.*)\.php$ /null.php last;
- rewrite ^\/customgroupicons\/(.*)\.php$ /null.php last;
- rewrite ^\/customprofilepics\/(.*)\.php$ /null.php last;
- rewrite ^\/signaturepics\/(.*)\.php$ /null.php last;
- rewrite ^\/vbseo_sitemap\/data\/(.*)\.php$ /null.php last;
- }
- location = /overload.html {
- root /var/www/vhosts/forum.coolsite.ru/httpdocs;
- }
- error_page 500 502 503 504 /overload.html;
- #чтобы картинки и js кэшировались
- location ~* \.(js|css|xml)$ {
- gzip_static on;
- expires 30d;
- }
- location ~* \.(jpg|jpeg|png|gif|ico)$ {
- expires 30d;
- }
- # статус работы nginx
- location = /nginx-sts {
- stub_status on;
- allow all;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment