wslhs 发表于 2018-11-8 11:04:29

FTP+Nginx图片服务器

# vi /opt/nginx/conf/nginx.conf  usernginx nginx;
  worker_processes1;
  pid      /opt/nginx/run/nginx/nginx.pid;
  events {
  worker_connections1024;
  }
  http {
  include       mime.types;
  default_typeapplication/octet-stream;
  log_formatmain'$remote_addr - $remote_user [$time_local] "$request" '
  '$status $body_bytes_sent "$http_referer" '
  '"$http_user_agent" "$http_x_forwarded_for"'
  '$upstream_addr $upstream_response_time $request_time ';
  log_format log404 '$status [$time_local] $remote_addr $host$request_uri $sent_http_location';
  access_loglogs/nginx/access.log main;
  access_loglogs/nginx/host.access.404.loglog404;
  sendfile      on;
  keepalive_timeout65;
  server {
  listen       8010;
  server_namelocalhost;
  large_client_header_buffers 4 128k;
  client_max_body_size 300m;
  client_body_buffer_size 128k;
  proxy_connect_timeout 600;
  proxy_read_timeout 600;
  proxy_send_timeout 600;
  proxy_buffer_size 64k;
  proxy_buffers   4 32k;
  proxy_busy_buffers_size 64k;
  proxy_temp_file_write_size 64k;
  location /nginxstatus{
  stub_status on;
  access_log on;
  auth_basic "nginxstatus";
  auth_basic_user_file htpasswd;
  }
  location ~ .*\.(gif|jpg|jpeg|png)$ {
  expires 24h;
  root /opt/upload;
  access_log /opt/nginx/logs/images.log;
  proxy_store on;
  proxy_store_access user:rw group:rw all:rw;
  proxy_temp_path         /opt/upload;
  proxy_redirect          off;
  proxy_set_header      Host 192.168.8.15;
  client_max_body_size    10m;
  client_body_buffer_size 1280k;
  proxy_connect_timeout   900;
  proxy_send_timeout      900;
  proxy_read_timeout      900;
  proxy_buffer_size       40k;
  proxy_buffers         40 320k;
  proxy_busy_buffers_size 640k;
  proxy_temp_file_write_size 640k;
  }
  location / {
  root   html;
  indexindex.html index.htm;
  }
  error_page   500 502 503 504/50x.html;
  location = /50x.html {
  root   html;
  }
  }

页: [1]
查看完整版本: FTP+Nginx图片服务器