|
@@ -1,55 +1,75 @@
|
|
|
|
+server_info off;
|
|
|
|
+server_tag EWS/1.0.0;
|
|
|
|
+log_empty_request off;
|
|
|
|
+
|
|
|
|
+gzip on;
|
|
|
|
+gzip_min_length 1k;
|
|
|
|
+gzip_buffers 4 16k;
|
|
|
|
+gzip_http_version 1.1;
|
|
|
|
+gzip_comp_level 7;
|
|
|
|
+gzip_types text/plain application/x-javascript text/css application/xml;
|
|
|
|
+gzip_vary on;
|
|
|
|
+
|
|
|
|
+proxy_redirect off ;
|
|
|
|
+proxy_http_version 1.1;
|
|
|
|
+proxy_set_header Connection "";
|
|
|
|
+proxy_set_header Host $host;
|
|
|
|
+proxy_set_header Referer $http_referer;
|
|
|
|
+proxy_set_header Cookie $http_cookie;
|
|
|
|
+proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
+proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
+proxy_connect_timeout 30;
|
|
|
|
+proxy_send_timeout 30;
|
|
|
|
+proxy_read_timeout 60;
|
|
|
|
+proxy_buffer_size 512k;
|
|
|
|
+proxy_buffers 8 512k;
|
|
|
|
+proxy_busy_buffers_size 512k;
|
|
|
|
+proxy_temp_file_write_size 512k;
|
|
|
|
+proxy_next_upstream error timeout http_503;
|
|
|
|
+
|
|
server
|
|
server
|
|
{
|
|
{
|
|
-listen 80;
|
|
|
|
-server_name 0.0.0.0;
|
|
|
|
-####################################
|
|
|
|
-location /status {
|
|
|
|
-check_status;
|
|
|
|
-access_log off;
|
|
|
|
-}
|
|
|
|
-####################################
|
|
|
|
|
|
+ listen 80;
|
|
|
|
+ server_name 0.0.0.0;
|
|
|
|
+ #charset GB2312;
|
|
|
|
|
|
-location ^~/aw2016 {
|
|
|
|
-rewrite ^.+ http://www.gdga.gov.cn/ztbd/aw2016/ last;
|
|
|
|
-break;
|
|
|
|
-}
|
|
|
|
|
|
+ location ~ /nginx_status {
|
|
|
|
+ stub_status on;
|
|
|
|
+ access_log off;
|
|
|
|
+ allow 10.0.0.0/8;
|
|
|
|
+ allow 192.168.0.0/16;
|
|
|
|
+ deny all;
|
|
|
|
+ }
|
|
|
|
|
|
-location / {
|
|
|
|
- if ($http_cookie ~* ".*uid=([^;]+)")
|
|
|
|
- {
|
|
|
|
- set $udid $1;
|
|
|
|
- }
|
|
|
|
- if ($http_cookie ~* "wver=wechat")
|
|
|
|
- {
|
|
|
|
- set $openid $cookie_wx_openid;
|
|
|
|
- }
|
|
|
|
- if ($http_cookie ~* "wver=alipay")
|
|
|
|
- {
|
|
|
|
- set $openid $cookie_alipay_openid;
|
|
|
|
- }
|
|
|
|
- # if ($http_cookie ~* "wver=online_ta")
|
|
|
|
- # {
|
|
|
|
- # set $luid $cookie_luid;
|
|
|
|
- # }
|
|
|
|
- set $uid $cookie_uid;
|
|
|
|
- if ($uid = ""){
|
|
|
|
- set $uid 0;
|
|
|
|
- }
|
|
|
|
-proxy_pass http://backend;
|
|
|
|
-error_page 404 = http://wap.easou.com;
|
|
|
|
-}
|
|
|
|
-location ~* \.(css|css\?.*|js|js\?.*|gif|jpg|jpeg|png|ico)$ {
|
|
|
|
- proxy_cache easou;
|
|
|
|
- proxy_cache_valid 200 10m;
|
|
|
|
- proxy_pass http://backend;
|
|
|
|
- expires 24h;
|
|
|
|
-}
|
|
|
|
-}
|
|
|
|
|
|
+ location ~ /cache {
|
|
|
|
+ proxy_pass http://backend;
|
|
|
|
+ allow 10.0.0.0/8;
|
|
|
|
+ allow 192.168.0.0/16;
|
|
|
|
+ deny all;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ if ($http_cookie ~* ".*uid=(.*?);.*$")
|
|
|
|
+ {
|
|
|
|
+ set $uid $1;
|
|
|
|
+ }
|
|
|
|
|
|
-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';
|
|
|
|
|
|
+ if ($request_uri ~* ".*wver=(\w*)")
|
|
|
|
+ {
|
|
|
|
+ set $mid $1;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ location ~* \.(css|css\?.*|js|js\?.*|gif|jpg|jpg\?.*|jpeg|png|ico)$ {
|
|
|
|
+ proxy_cache easou;
|
|
|
|
+ proxy_cache_valid 200 10m;
|
|
|
|
+ proxy_pass http://backend;
|
|
|
|
+ access_log off;
|
|
|
|
+}
|
|
|
|
|
|
|
|
+ location / {
|
|
|
|
+ proxy_pass http://backend;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
-access_log /log/nginx/visit/access.log www.easou.com;
|
|
|
|
|
|
+log_format i.easou.com 'v1{]i.easou.com{]$request{]$upstream_http_esid{]$year$month$day $hour$minute$second{]$status{]-{]$request_time_msec{]$body_bytes_sent{]$bytes_sent{]$remote_addr{]$http_x_forwarded_for{]$http_referer{]$sent_http_mobile{]$http_user_agent{]_$mid{]$uid{]$http_via{]v1';
|
|
|
|
+access_log /log/nginx/visit/access.log i.easou.com;
|
|
include vhosts/www/hostlist.conf;
|
|
include vhosts/www/hostlist.conf;
|