0
我是Android開發者和我的應用程序的請求到我的服務器下載debuge顯示文件插入多請求由一個請求
Log.d("SBP", f_url[0]);
URL url = new URL(f_url[0]);
URLConnection conection = url.openConnection();
一個請求,但在服務器當我打開的access.log我看到2或更多相同的請求! :|
但爲什麼?
這是我nginx.config
user nginx;
worker_processes 1;
worker_rlimit_nofile 20000;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
,這是我的網站的配置:
server {
server_name MYSITE;
access_log /srv/www/MYSITE/logs/access.log;
error_log /srv/www/MYSITE/logs/error.log;
root /srv/www/MYSITE/public;
client_max_body_size 20m;
client_body_buffer_size 128k;
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 360d;
}
location/{
index index.html index.htm index.php;
}
location ~ /\. {
access_log off;
log_not_found off;
deny all;
}
location ~* \.php$ {
# include /etc/nginx/fastcgi_params;
server_tokens off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
請包含access.log條目。 – 2015-02-09 06:44:25
MYIP - [08/Feb/2015:22:28:39 +0330]「GET /api/v1/Download_File.php?id=9&type=mp3&filename=1.mp3&rquest=download HTTP/1.1」200 344189「 - 」 「GET/api/1.6.0(Linux; U; Android 4.1.2; ST26i Build/11.2.A.0.31)」 MYIP - - [08/Feb/2015:22:28:39 +0330] v1/Download_File.php?id = 9&type = mp3&filename = 1.mp3&rquest =下載HTTP/1.1「200 344189」 - 「」Dalvik/1.6.0(Linux; U; Android 4.1.2; ST26i Build/11.2.A.0.31 )「 – SBP 2015-02-09 14:20:49
@DmitryVerkhoturov:謝謝。因爲你看到2請求插入access.log和我的數據庫中增加下載計數器+2 – SBP 2015-02-09 14:22:26