server {
listen 8081; #端口号
server_name 172.22.203.12; #服务器地址
charset utf-8;
root /home/Preview #要映射的静态资源路劲
}
Why do I want to say that simple?
Because I want to say a pit - if the root / Home / preivew changed to root / tmp / Preview is bound to be wrong.
The reason: linux (CentOs7) of tmp folder rather special,
/ Tmp / temporary folder mapping do not use nginx!
/ Tmp / temporary folder mapping do not use nginx!
/ Tmp / temporary folder mapping do not use nginx!
over
I do not want to see without looking below
I do laboratory, preview files pages:
pdf preview
Picture Preview
xls Preview
This preview function using a code on the cloud KKFileView
In fact, back then URL url = file address is mapped nginx, I have started on the / tmp / folder, so the pit for a while, came to record, to see friends attention.