Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80 default_server;
- access_log off;
- error_log off;
- # error_log /home/domain.com/logs/error.log;
- root /home/domain.com/public_html;
- index index.php index.html index.htm;
- server_name domain.com;
- # nginx configuration
- index index.php;
- location / {
- if ($http_host ~* "^www\.domain\.com"){
- rewrite ^(.*)$ http://domain/$1 redirect;
- }
- rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 break;
- rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 break;
- rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 break;
- rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 break;
- rewrite ^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html$ /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 break;
- rewrite ^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html$ /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 break;
- rewrite ^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html$ /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 break;
- rewrite ^/([^.]+)/([0-9]+)-(.*).html$ /index.php?newsid=$2&seourl=$3&seocat=$1 break;
- rewrite ^/([0-9]+)-(.*).html$ /index.php?newsid=$1&seourl=$2 break;
- rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/*$" /index.php?year=$1&month=$2&day=$3 break;
- rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)/*$" /index.php?year=$1&month=$2&day=$3&cstart=$4 break;
- rewrite "^/([0-9]{4})/([0-9]{2})/*$" /index.php?year=$1&month=$2 break;
- rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)/*$" /index.php?year=$1&month=$2&cstart=$3 break;
- rewrite "^/([0-9]{4})/*$" /index.php?year=$1 break;
- rewrite "^/([0-9]{4})/page/([0-9]+)/*$" /index.php?year=$1&cstart=$2 break;
- if (!-e $request_filename){
- rewrite ^/([^.]+)/page/([0-9]+)/*$ /index.php?do=cat&category=$1&cstart=$2 break;
- }
- rewrite ^/([^.]+)/?$ /index.php?do=cat&category=$1 break;
- if (!-e $request_filename){
- rewrite ^/([^.]+)/rss.xml$ /engine/rss.php?do=cat&category=$1 break;
- }
- if (!-e $request_filename){
- rewrite ^/([^/]+).html$ /index.php?do=static&page=$1&seourl=$1 break;
- }
- }
- location /page {
- rewrite ^/page/([0-9]+)(/?)$ /index.php?cstart=$1 break;
- rewrite ^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html$ /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 break;
- rewrite ^/page,([0-9]+),([0-9]+)-(.*).html$ /index.php?newsid=$2&news_page=$1&seourl=$3 break;
- rewrite ^/page,([0-9]+),([^/]+).html$ /index.php?do=static&page=$2&news_page=$1&seourl=$2 break;
- }
- location /print {
- rewrite ^/print:page,([0-9]+),([0-9]+)-(.*).html$ /engine/print.php?news_page=$1&newsid=$2&seourl=$3 break;
- rewrite ^/print:([^/]+).html$ /engine/print.php?do=static&page=$1&seourl=$1 break;
- }
- location /tags {
- rewrite ^/tags/([^/]*)/*$ /index.php?do=tags&tag=$1 break;
- rewrite ^/tags/([^/]*)/page/([0-9]+)/*$ /index.php?do=tags&tag=$1&cstart=$2 break;
- }
- location /xfsearch {
- rewrite ^/xfsearch/([^/]*)/*$ /index.php?do=xfsearch&xf=$1 break;
- rewrite ^/xfsearch/([^/]*)/page/([0-9]+)/*$ /index.php?do=xfsearch&xf=$1&cstart=$2 break;
- }
- location /user {
- rewrite ^/user/([^/]*)/rss.xml$ /engine/rss.php?subaction=allnews&user=$1 break;
- rewrite ^/user/([^/]*)/*$ /index.php?subaction=userinfo&user=$1 break;
- rewrite ^/user/([^/]*)/page/([0-9]+)/*$ /index.php?subaction=userinfo&user=$1&cstart=$2 break;
- rewrite ^/user/([^/]*)/news/*$ /index.php?subaction=allnews&user=$1 break;
- rewrite ^/user/([^/]*)/news/page/([0-9]+)/*$ /index.php?subaction=allnews&user=$1&cstart=$2 break;
- rewrite ^/user/([^/]*)/news/rss.xml/*$ /engine/rss.php?subaction=allnews&user=$1 break;
- }
- location /lastnews {
- rewrite ^/lastnews/*$ /index.php?do=lastnews break;
- rewrite ^/lastnews/page/([0-9]+)/*$ /index.php?do=lastnews&cstart=$1 break;
- }
- location /catalog {
- rewrite ^/catalog/([^/]*)/rss.xml$ /engine/rss.php?catalog=$1 break;
- rewrite ^/catalog/([^/]*)/*$ /index.php?catalog=$1 break;
- rewrite ^/catalog/([^/]*)/page/([0-9]+)/*$ /index.php?catalog=$1&cstart=$2 break;
- }
- location /newposts {
- rewrite ^/newposts/*$ /index.php?subaction=newposts break;
- rewrite ^/newposts/page/([0-9]+)/*$ /index.php?subaction=newposts&cstart=$1 break;
- }
- location /favorites {
- rewrite ^/favorites/*$ /index.php?do=favorites break;
- rewrite ^/favorites/page/([0-9]+)/*$ /index.php?do=favorites&cstart=$1 break;
- }
- location = /rules.html {
- rewrite ^(.*)$ /index.php?do=rules break;
- }
- location = /statistics.html {
- rewrite ^(.*)$ /index.php?do=stats break;
- }
- location = /addnews.html {
- rewrite ^(.*)$ /index.php?do=addnews break;
- }
- location = /rss.xml {
- rewrite ^(.*)$ /engine/rss.php break;
- }
- location = /sitemap.xml {
- rewrite ^(.*)$ /uploads/sitemap.xml break;
- }
- location ~ \.php$ {
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- include /etc/nginx/fastcgi_params;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_connect_timeout 60;
- fastcgi_send_timeout 180;
- fastcgi_read_timeout 180;
- fastcgi_buffer_size 256k;
- fastcgi_buffers 4 256k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- fastcgi_intercept_errors on;
- fastcgi_param SCRIPT_FILENAME /home/dlbin.com/public_html$fastcgi_script_name;
- }
- location /nginx_status {
- stub_status on;
- access_log off;
- }
- location /php_status {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /home/dlbin.com/public_html$fastcgi_script_name;
- include /etc/nginx/fastcgi_params;
- }
- location ~ /\. {
- deny all;
- }
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- }
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- location ~* \.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|eot|svg|ttf|woff)$ {
- gzip_static off;
- add_header Pragma public;
- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
- access_log off;
- expires 30d;
- break;
- }
- location ~* \.(txt|js|css)$ {
- add_header Pragma public;
- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
- access_log off;
- expires 30d;
- break;
- }
- #error_page 403 /403.html;
- location = /403.html {
- root /usr/share/nginx/html;
- allow all;
- }
- #error_page 404 /404.html;
- location = /404.html {
- root /usr/share/nginx/html;
- allow all;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement