使用nginx转发过去给php

server{
listen 9099;
server_name 18.5.6.2;
location / {
proxy_http_version 1.1;
root /opt/zidian/crackPass;
index index.html index.htm index.php;
}
location ~* \.php$ {
root /opt/zidian/crackPass;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /opt/zidian/crackPass$fastcgi_script_name;
include fastcgi_params;
}
}

server_name  公网ip

fastcgi_pass 127.0.0.1:9000   转发给php(使用netstat -tlnp | grep php看到php的端口是9000)

index.php

<?php
#echo "<body style='background:url(o_cheng.jpg)'; backgroundRepeat:'no-repeat'; backgroundPosition='top center'; >";
header("Content-type: text/html; charset=utf-8");
function getsize($size, $format = 'kb') {
$p = 0;
if ($format == 'kb') {
$p = 1;
} elseif ($format == 'mb') {
$p = 2;
} elseif ($format == 'gb') {
$p = 3;
}
$size /= pow(1024, $p);
return number_format($size, 3);
}
function read_all ($dir){
if(!is_dir($dir)) return false; $handle = opendir($dir); if($handle){
while(($fl = readdir($handle)) !== false){
$temp = iconv('utf-8','utf-8',$dir.DIRECTORY_SEPARATOR.$fl);
if(is_dir($temp) && $fl!='.' && $fl != '..'){
#echo '目录:'.$temp.'<br>';
#read_all($temp);
}else{
if($fl!='.' && $fl != '..'){
#echo $fl;
#echo '文件:'.$temp.'<br>';
$cfiletime = filectime($fl);
echo "文件:";
echo "<span style='font-size:6px;'>";
echo "<a href='$fl' download='$fl'>'$fl'";
echo "</a>";
echo "</span>";
$size = filesize($fl);
$size = getsize($size, 'mb');
echo "容量:";
echo "<span style='font-size:6px;'>$size.'M'";
echo "</span>";
# echo "创建时间:";
# echo "<span style='font-size:6px;'>" .date("Y-m-d H:i:s",$cfiletime);
echo "</span>";
echo "<br>";
}
}
}
}
}
read_all('.');
echo "<br/>";
echo "<a href='400W常用密码/index.php'>";
echo "<button>400W常用密码</button>";
echo "</a>";
#echo "</body>";
?>

index.php(2018-06-21)

<?php
#echo "<body style='background:url(o_cheng.jpg)'; backgroundRepeat:'no-repeat'; backgroundPosition='top center'; >";
header("Content-type: text/html; charset=utf-8");
echo "<h3 align='center'>";
echo "夏天分享小知识";
echo "</h3>";
ini_set('date.timezone','Asia/Shanghai');
function getsize($size, $format = 'kb') {
$p = 0;
if ($format == 'kb') {
$p = 1;
} elseif ($format == 'mb') {
$p = 2;
} elseif ($format == 'gb') {
$p = 3;
}
$size /= pow(1024, $p);
return number_format($size, 3);
}
function read_all ($dir){
if(!is_dir($dir)) return false; $handle = opendir($dir); if($handle){
while(($fl = readdir($handle)) !== false){
$temp = iconv('utf-8','utf-8',$dir.DIRECTORY_SEPARATOR.$fl);
if(is_dir($temp) && $fl!='.' && $fl != '..'){
#echo '目录:'.$temp.'<br>';
#read_all($temp);
}else{
if($fl!='.' && $fl != '..'){
#echo $fl;
#echo '文件:'.$temp.'<br>';
$cfiletime = filectime($fl);
echo "<table>";
echo "<td width=400px>";
echo "文件:";
echo "<span style='font-size:6px;'>";
echo "<a href='$fl' download='$fl'>'$fl'";
echo "</a>";
echo "</span>";
$size = filesize($fl);
$size = getsize($size, 'mb');
echo "</td>";
echo "<td width=400px>";
echo "容量:";
echo "<span style='font-size:6px;'>$size.'M'";
echo "</span>";
echo "</td>";
echo "<td width=400px>";
echo "修改时间:";
echo "<span style='font-size:6px;'>" .date("Y-m-d H:i:s",$cfiletime);
echo "</span>";
echo "<br>";
echo "</td>";
echo "</table>";
}
}
}
}
}
read_all('.');
echo "<br/>";
echo "<a href='400W常用密码/index.php'>";
echo "<button>400W常用密码</button>";
echo "</a>";
echo " ";
echo "<a href='WPA英文字典/index.php'>";
echo "<button>WPA英文字典</button>";
echo "</a>";
echo " ";
echo "<a href='弱口令集/index.php'>";
echo "<button>弱口令集</button>";
echo "</a>";
echo " ";
echo "<a href='生日1980-2010年/index.php'>";
echo "<button>生日1980-2010年</button>";
echo "</a>";
echo " ";
echo "<a href='超级字典/index.php'>";
echo "<button>超级字典</button>";
echo "</a>";
#echo "</body>";
?>

返回(2018-06-21)

<?php
#echo "<body style='background:url(o_cheng.jpg)'; backgroundRepeat:'no-repeat'; backgroundPosition='top center'; >";
header("Content-type: text/html; charset=utf-8");
echo "<h3 align='center'>";
echo "夏天分享小知识";
echo "</h3>";
ini_set('date.timezone','Asia/Shanghai');
function getsize($size, $format = 'kb') {
$p = 0;
if ($format == 'kb') {
$p = 1;
} elseif ($format == 'mb') {
$p = 2;
} elseif ($format == 'gb') {
$p = 3;
}
$size /= pow(1024, $p);
return number_format($size, 3);
}
function read_all ($dir){
if(!is_dir($dir)) return false; $handle = opendir($dir); if($handle){
while(($fl = readdir($handle)) !== false){
$temp = iconv('utf-8','utf-8',$dir.DIRECTORY_SEPARATOR.$fl);
if(is_dir($temp) && $fl!='.' && $fl != '..'){
#echo '目录:'.$temp.'<br>';
#read_all($temp);
}else{
if($fl!='.' && $fl != '..'){
#echo $fl;
#echo '文件:'.$temp.'<br>';
$cfiletime = filectime($fl);
$mfiletime = filemtime($fl);
echo "<table>";
echo "<td width=400px>";
echo "文件:";
echo "<span style='font-size:6px;'>";
echo "<a href='$fl' download='$fl'>'$fl'";
echo "</a>";
echo "</span>";
$size = filesize($fl);
$size = getsize($size, 'mb');
echo "</td>";
echo "<td width=400px>";
echo "容量:";
echo "<span style='font-size:6px;'>$size.'M'";
echo "</span>";
echo "</td>";
echo "<td width=400px>";
echo "修改时间:";
echo "<span style='font-size:6px;'>".date("Y-m-d H:i:s",$cfiletime);
echo "</span>";
#echo "创建时间:".date("Y-m-d H:i:s",$cfiletime);
#echo "修改时间:".date("Y-m-d H:i:s",$mfiletime);
echo "<br>";
echo "</td>";
echo "</table>";
}
}
}
}
}
read_all('.');
echo "<br/>";
echo "<a href='../index.php'>";
echo "<button>返回</button>";
echo "</a>";
#echo "</body>";
?>

作用:点击链接实现下载文件

最新文章

  1. redis配置文件redis.conf中文版(基于2.4)
  2. JVM 小结
  3. EF &ndash; 7.一对多关联
  4. 转: maven进阶:一个多模块项目
  5. thrift在windows的编译/安装--c++版
  6. virtualbox安装增强包及配置共享文件夹
  7. MySQL 数据库增量数据恢复案例
  8. ARM GCC CodeSourcery 下载地址
  9. Delphi xe10下载(包含破解补丁和破解视频)
  10. 将JSON数组显示前台Table中
  11. CSS3秘笈复习:第八章
  12. VS2010与SVN
  13. 在go中使用json作为主要的配置格式
  14. jdk7和8中关于HashMap和concurrentHashMap的扩容过程总结,以及HashMap死循环
  15. 通过CONN_MAX_AGE优化Django的数据库连接
  16. 使用WebClient调用第三方接口
  17. Javascript日常编码中的一些常见问题
  18. java 线程(七)等待与唤醒
  19. Spring Data JPA中的动态查询 时间日期
  20. linux中线程池【转】

热门文章

  1. 20165321实验一 Java开发环境的熟悉
  2. 笔记 : win8系统中的VM虚拟机的Ubuntu搭建samba服务
  3. js执行上下文
  4. Unity shader学习之Alpha Test的阴影
  5. c++引用和指针的彻底理解
  6. uvalive 5731 Qin Shi Huang’s National Road System
  7. 【Scala学习之二】 Scala 集合 Trait Actor
  8. 用django统计代码行数+注释行数
  9. Lucene 个人领悟 (二)
  10. Autel Maxisys MS908CV Description