nginx的location虚拟目录配置:
monitor.confserver {
server_name monitor.chinasoft.com;
server_name 1.1.1.1;
error_log /data/logs/web-acccess.log info;
access_log /data/logs/web-error.log;
location /jiankongshare{
alias /data/monitor_share; #正式环境地址
index index.html;
}
location /jian/{
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8082/;#正式服务器地址
}
}
访问1.1.1.1/jiankongshare报错如下:
2017/04/07 10:15:54 [error] 23876#0: *1 open() "/usr/share/nginx/html/jiankongshare" failed (2: No such file or directory), cli