文檔伺服器搭建markdown
A. markdown nginx 搭建自己的圖片伺服器
介紹
在使用markdown格式的過程中,經常需要上傳圖片,但是常常很復雜,image,在csdn上也很麻煩,在我有阿里雲的情況下,用nginx實現我的圖片伺服器.
安裝 OpenResty
OpenResty,以前用過,所以就按照文檔快速安裝.
apt-get install libpcre3-dev libssl-dev perl make build-essential curl
./configure
make
make install
默認目錄 :/usr/local/openresty/
添加配置文件
cd /usr/local/openresty/
mkdir conf/
vi nginx.conf
配置文件具體內容
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
server {
listen 8080;
location ~ .*.(gif|jpg|jpeg|png)$ {
expires 24h;
root /home/images/;#指定圖片存放路徑
access_log /home/nginx/logs/images.log;#圖片 日誌路徑
proxy_store on;
proxy_store_access user:rw group:rw all:rw;
proxy_temp_path /home/images/;#代理臨時路徑
proxy_redirect off;
}
啟動
./openresty -c ../conf/nginx.conf
./openresty -s stop
netstat -antp
x
image
通過 SecureCRT 7.0拖拽上傳文件
image
通過 get -r * 同步文件到本地
image
訪問即可
https://blog.csdn.net/better_mouse/java/article/details/84256664