经过各种图床折腾之后,发现可以在自己的服务器中直接建立 nginx 站点作为专门的图床使用,本文记录相关内容。
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: POODLE
ssl_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/*;
}
sudo nginx -s reload
web-url / file-path
1.png
web-url / 1.png
即可直接看到图像内容