www.conf 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. server
  2. {
  3. listen 80;
  4. server_name 0.0.0.0;
  5. ####################################
  6. location /status {
  7. #check_status;
  8. access_log off;
  9. }
  10. ####################################
  11. location ^~/aw2016 {
  12. rewrite ^.+ http://www.gdga.gov.cn/ztbd/aw2016/ last;
  13. break;
  14. }
  15. location / {
  16. if ($http_cookie ~* ".*uid=([^;]+)")
  17. {
  18. set $udid $1;
  19. }
  20. if ($http_cookie ~* "wver=wechat")
  21. {
  22. set $openid $cookie_wx_openid;
  23. }
  24. if ($http_cookie ~* "wver=alipay")
  25. {
  26. set $openid $cookie_alipay_openid;
  27. }
  28. # if ($http_cookie ~* "wver=online_ta")
  29. # {
  30. # set $luid $cookie_luid;
  31. # }
  32. set $uid $cookie_uid;
  33. if ($uid = ""){
  34. set $uid 0;
  35. }
  36. proxy_pass http://backend;
  37. error_page 404 = http://wap.easou.com;
  38. }
  39. location ~* \.(css|css\?.*|js|js\?.*|gif|jpg|jpeg|png|ico)$ {
  40. proxy_cache easou;
  41. proxy_cache_valid 200 10m;
  42. proxy_pass http://backend;
  43. expires 24h;
  44. }
  45. }
  46. log_format www.easou.com 'v2{]easou.com{]$request{]$upstream_http_esid{]$year$month$day $hour$minute$second{]$status{]-{]$request_time{]$body_bytes_sent{]$bytes_sent{]$remote_addr{]$http_x_forwarded_for{]$http_referer{]$sent_http_mobile{]$http_user_agent{]_$upstream_http_mid{]$udid{]$http_via{]$uid{]$cookie_cid{]$openid{]v2';
  47. access_log /log/nginx/visit/access.log www.easou.com;
  48. include vhosts/www/hostlist.conf;