book.conf 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #gzip on;
  2. gzip_min_length 1k;
  3. gzip_buffers 4 16k;
  4. gzip_http_version 1.1;
  5. gzip_comp_level 7;
  6. gzip_types text/plain application/x-javascript text/css application/xml application/json;
  7. gzip_vary on;
  8. server
  9. {
  10. listen 80;
  11. server_name 0.0.0.0;
  12. #server_name api.appeasou.com api.easou.com api.easou.com.cn api.ps.easou.com api.ps.appeasou.com api.ps.easou.com.cn;
  13. #charset ISO-88509-1;
  14. #default_type 'application/x-javascript;charset=utf-8';
  15. ####################################
  16. location /status {
  17. stub_status on;
  18. access_log off;
  19. }
  20. location /check.html {
  21. access_log off;
  22. root html;
  23. }
  24. ####################################
  25. location / {
  26. lua_need_request_body on;
  27. content_by_lua 'local s = ngx.var.request_body';
  28. if ($http_cookie ~* ".*uid=(.*?);.*$")
  29. {
  30. set $uid $1;
  31. }
  32. # if ($http_cookie ~* ".*wver=([a-z]{1,3}).*$") {
  33. # set $mid $1;
  34. # }
  35. if ($arg_version = "002")
  36. {
  37. gzip on;
  38. }
  39. if ($request_uri ~* "phonevcode.m") {
  40. set $udid Y;
  41. }
  42. if ($request_uri ~* "04DF3BD2E4ABC777178BF81D2A5A2C85|pushid=160a3797c86e80e490b") {
  43. set $udid "${udid}Y";
  44. }
  45. # if ($http_x_forwarded_for ~* "140.249.25.4|223.99.225.242|47.104.189.234"){
  46. # set $udid "${udid}Y";
  47. # }
  48. if ($udid = YY) {
  49. return 403;
  50. }
  51. if ($udid = YYY) {
  52. return 403;
  53. }
  54. #if ($http_referer ~* "04DF3BD2E4ABC777178BF81D2A5A2C85") {
  55. # #rewrite ^/ http://223.99.225.200:81;
  56. # return 403;
  57. #}
  58. #if ($request_uri ~* ".*chapter_list.*appverion.*os.*nid.*gid.*udid.*ch.*")
  59. if ($request_uri ~* "5DFB568E03AA473E935CB4938EEABFB0|09E26261CA0E83345A7C3FFA4BC9665B|1CD36DE4D4D16379AE34190257A6ACC9|HOq2T4rj5vzuTHw2V81BitalcA9Ut|C9C12A31E5CDE899F35CDF2AA45B03D5|09053442eef08741ed2fd376dc1a61581154bbef|04DF3BD2E4ABC777178BF81D2A5A2C85|CCA85FE110CABA44AC60DB21C17C73E6|58D69B86ACFBCB971EF7B4A743A3C09B|3E9A05076F42B5643E335B13490FC27B|7C420B097EBCD3B97A254AAB018B17CF|3EC834A7F048B3EE6DD4FA0D3C1351DA")
  60. {
  61. #rewrite ^/ http://223.99.225.200:81;
  62. return 403;
  63. }
  64. if ($http_user_agent ~* "QiDian|douban|cyhj|sjmz|ydsc|jmktcyw") {
  65. return 403;
  66. }
  67. proxy_pass http://api.ieasou.cn;
  68. proxy_redirect off ;
  69. proxy_http_version 1.1;
  70. proxy_set_header Connection "";
  71. proxy_set_header Host $host;
  72. proxy_set_header Referer $http_referer;
  73. proxy_set_header Cookie $http_cookie;
  74. proxy_set_header X-Real-IP $remote_addr;
  75. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  76. client_max_body_size 70m;
  77. client_body_buffer_size 800k;
  78. proxy_connect_timeout 35s;
  79. proxy_send_timeout 35s;
  80. proxy_read_timeout 35s;
  81. proxy_buffer_size 512k;
  82. proxy_buffers 4 512k;
  83. proxy_busy_buffers_size 512k;
  84. proxy_temp_file_write_size 512k;
  85. proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404;
  86. proxy_max_temp_file_size 128m;
  87. #proxy_headers_hash_bucket_size 64;
  88. ###set log##
  89. }
  90. }
  91. log_format api.easou.com 'v1{]api.ieasou.cn{]$request{]HHvDHAMjq2I{]$year$month$day $hour$minute$second{]$status{]-{]$request_time_usec{]$body_bytes_sent{]$bytes_sent{]$remote_addr{]$http_x_forwarded_for{]$http_referer{]$request_body{]$http_user_agent{]-{]$uid{]$http_via{]v1';
  92. access_log /data/log/resin-books/bo/visit/access.log api.easou.com buffer=128k;
  93. include vhosts/book/hostlist.conf;
  94. include vhosts/book/https.conf;