式式共和国

  1. user www www;
  2. worker_processes 8;
  3. error_log /wlogs/nginx_error.log crit;
  4. pid /usr/local/nginx/nginx.pid;
  5. #Specifies the value for maximum file descriptors that can be opened by this process.
  6. worker_rlimit_nofile 65535;
  7. events
  8. {
  9. use epoll;
  10. worker_connections 65535;
  11. }
  12. http
  13. {
  14. include mime.types;
  15. default_type application/octet-stream;
  16. #charset gb2312;
  17. server_names_hash_bucket_size 128;
  18. client_header_buffer_size 32k;
  19. large_client_header_buffers 4 32k;
  20. client_max_body_size 8m;
  21. sendfile on;
  22. tcp_nopush on;
  23. keepalive_timeout 60;
  24. tcp_nodelay on;
  25. fastcgi_connect_timeout 300;
  26. fastcgi_send_timeout 300;
  27. fastcgi_read_timeout 300;
  28. fastcgi_buffer_size 64k;
  29. fastcgi_buffers 4 64k;
  30. fastcgi_busy_buffers_size 128k;
  31. fastcgi_temp_file_write_size 128k;
  32. gzip on;
  33. gzip_min_length 1k;
  34. gzip_buffers 4 16k;
  35. gzip_http_version 1.0;
  36. gzip_comp_level 2;
  37. gzip_types text/plain application/x-javascript text/css application/xml;
  38. gzip_vary on;
  39. #limit_zone crawler $binary_remote_addr 10m;
  40. server
  41. {
  42. listen 80;
  43. server_name 192.168.6.168;
  44. index index.html index.htm index.php;
  45. root /web;
  46. #limit_conn crawler 20;
  47. location ~ .*\.(php|php5)?$
  48. {
  49. #fastcgi_pass unix:/tmp/php-cgi.sock;
  50. fastcgi_pass 127.0.0.1:9000;
  51. fastcgi_index index.php;
  52. include fcgi.conf;
  53. }
  54. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  55. {
  56. expires 30d;
  57. }
  58. location ~ .*\.(js|css)?$
  59. {
  60. expires 1h;
  61. }
  62. log_format access '$remote_addr - $remote_user [$time_local] "$request" '
  63. '$status $body_bytes_sent "$http_referer" '
  64. '"$http_user_agent" $http_x_forwarded_for';
  65. access_log /wlogs/access.log access;
  66. }
  67. server
  68. {
  69. listen 80;
  70. server_name www.my96669.com;
  71. index index.html index.htm index.php;
  72. root /web/tuangou;
  73. location /web/tuangou {
  74. if (-f $request_filename){
  75. set $rule_0 1;
  76. }
  77. if (-d $request_filename){
  78. set $rule_0 1;
  79. }
  80. rewrite ^index\.html$ index\.php last;
  81. rewrite ^Index\.html$ index\.php last;
  82. rewrite ^c\.html$ index\.php\?m=Goods&a=index permanent;
  83. rewrite ^c-([0-9]+)(.*)\.html(.*)$ index\.php\?m=Goods&a=index&id=$1$3 permanent;
  84. rewrite ^ac\.html$ index\.php\?m=Article&a=index permanent;
  85. rewrite ^ac-([0-9]+)(.*)\.html(.*)$ index\.php\?m=Article&a=index&id=$1$3 permanent;
  86. rewrite ^tg-([0-9]+)\.html(.*)$ index\.php\?m=Goods&a=show&id=$1$2 permanent;
  87. rewrite ^tg-([0-9]+)-ru-([0-9]+)\.html$ index\.php\?m=Goods&a=show&id=$1&ru=$2 permanent;
  88. rewrite ^tg-([0-9]+)-(\w+)-(\w+)\.html(.*)$ index\.php\?m=Goods&a=show&id=$1&$2=$3&$4 permanent;
  89. rewrite ^tg-([0-9]+)-(\w+)-(\w+)-(\w+)-(\w+)\.html(.*)$ index\.php\?m=Goods&a=show&id=$1&$2=$3&$4=$5&$6 permanent;
  90. rewrite ^wz-([0-9]+)(.*)\.html(.*)$ index\.php\?m=Article&a=show&id=$1$3 permanent;
  91. rewrite ^z-(\w+)(.*)\.html(.*)$ index\.php\?m=Index&a=index&cityname=$1$3 permanent;
  92. rewrite ^sp\.html$ index\.php\?m=Suppliers&a=index permanent;
  93. rewrite ^a-(\w+)(.*)\.html(.*)$ index\.php\?m=Article&a=showByUname&uname=$1$3 permanent;
  94. rewrite ^g-(\w+)(.*)\.html(.*)$ index\.php\?m=Goods&a=showByUname&uname=$1$3 permanent;
  95. rewrite ^(\w+)-(\w+)\.html(.*)$ index\.php\?m=$1&a=$2$3 permanent;
  96. rewrite ^(\w+)-(\w+)-(\w+)\.html(.*)$ index\.php\?m=$1&a=$2&$3$4 permanent;
  97. rewrite ^(\w+)-(\w+)-(\w+)-(\w+)\.html(.*)$ index\.php\?m=$1&a=$2&$3=$4$5 permanent;
  98. rewrite ^(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)\.html(.*)$ index\.php\?m=$1&a=$2&$3=$4&$5=$6$7 permanent;
  99. rewrite ^(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)\.html(.*)$ index\.php\?m=$1&a=$2&$3=$4&$5=$6&$7=$8$9 permanent;
  100. rewrite ^(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)\.html(.*)$ index\.php\?m=$1&a=$2&$3=$4&$5=$6&$7=$8&$9=$10$11 permanent;
  101. rewrite ^(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)\.html(.*)$ index\.php\?m=$1&a=$2&$3=$4&$5=$6&$7=$8&$9=$10&$11=$12$13 permanent;
  102. rewrite ^(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)-(\w+)\.html(.*)$ index\.php\?m=$1&a=$2&$3=$4&$5=$6&$7=$8&$9=$10&$11=$12&$13=$14$15 permanent;
  103. }
  104. location ~ .*\.(php|php5)?$
  105. {
  106. #fastcgi_pass unix:/tmp/php-cgi.sock;
  107. fastcgi_pass 127.0.0.1:9000;
  108. fastcgi_index index.php;
  109. include fcgi.conf;
  110. }
  111. log_format tuangoulogs '$remote_addr - $remote_user [$time_local] "$request" '
  112. '$status $body_bytes_sent "$http_referer" '
  113. '"$http_user_agent" $http_x_forwarded_for';
  114. access_log /wlogs/tuangoulogs.log tuangoulogs;
  115. }
  116. }
文档更新时间: 2018-04-13 01:46