安装nginx
sudo apt-get install nginx
配置nginx.conf
sudo vim /etc/nginx/nginx.conf
worker_processes auto;
pid /run/nginx.pid;events {worker_connections 768;# multi_accept on;
}http {sendfile on;tcp_nopush on;tcp_nodelay on;keepalive_timeout 65;types_hash_max_size 2048;include /etc/nginx/mime.types;default_type application/octet-stream;ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLEssl_prefer_server_ciphers on;access_log /var/log/nginx/access.log;error_log /var/log/nginx/error.log;gzip on;gzip_disable "msie6";server{listen 80;server_name localhost;location /{root /;# autoindex on;}}include /etc/nginx/conf.d/*.conf;#include /etc/nginx/sites-enabled/*;
}
重启nginx
sudo nginx -s reload
访问ip/xxx/xxx.jpg即可得到图片资源