服务器运行磁盘较小,重新挂载一个磁盘,路径为/data 项目根目录路径/var/ww/root/html 项目需求:下载data下的文件,于是配置了一个新的server :
#文件下载
server {
listen 81;
server_name localhost;
location / {
root /data;
index index.html index.htm index.php ;
try_files $uri $uri/ /index.php$is_args$args;
}
error_page 500 502 503 504 /50x.html;location = /50x.html {
root html;}
location ~ \.php$ {
root /data;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}}
现在通过url:
```html
”<a
- href="ip:81/data/aa.xml'" download class="easyui-linkbutton c9 l-btn l-btn-small">“
```地址下载文件 发现文件直接在浏览器打开 有说是服务器跨站的问题 现在不知道怎么解决。
需求aa.xml文件正常下载就行