# 配置一个server 专门用于存放图片
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
# 配置访问图片
location / {
root /cim/images;
index index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html?s=$1 last;
break;
}
}
#配置另一个访问图片
location /camera {
alias /camera;
index index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html?s=$1 last;
break;
}
}
# 配置另一个server 专门前端项目用
server {
listen 8008;
server_name localhost;
location / {
#对应前台打包的出来的文件 需要放到的目录下
root /usr/local/project/front;
index index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html?s=$1 last;
break;
}
}
|