1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
| server { server_name zhjw.scse.hebut.edu.cn littledog.cn zhjw.hebut.edu.cn; listen 80;
#开启页面压缩 gzip on; gzip_min_length 1k; gzip_buffers 4 16k; #gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain application/x-JavaScript text/css application/xml text/javascript; gzip_vary off; gzip_disable "MSIE [1-6]\."; #反向代理的默认设定 location / { index index.php index.html index.htm; root /data/www/zhjw.scse.hebut.edu.cn/htdocs; #反向代理设置 proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; include fastcgi_params; proxy_pass http://zhjw.hebut.edu.cn/;
#指定替换类型 subs_filter_types text/html text/css text/xml;
#登录后起始页设定为本站 start.php subs_filter '<frame src="" id="mainF"' '<frame src="/start.php" id="mainF"' gi;
#指定使用高速浏览模式,但貌似对360浏览器无效,360浏览器对于教育网网站总是启用兼容模式 subs_filter '<head>' '<head><meta name="renderer" content="webkit"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">' gi;
#一些需要修改内容的页面装载 jquery,jqprint,printArea subs_filter '<link href="css/style.css" rel="stylesheet" type="text/css">' '<link href="css/style.css" rel="stylesheet" type="text/css"><script src="/assets/js/jquery-1.8.2.min.js"></script><script src="/assets/js/jquery.PrintArea.js"></script><script src="/assets/js/jquery.jqprint.js"></script>' gi; subs_filter '<link rel="stylesheet" type="text/css" href="styles.css">' '<link rel="stylesheet" type="text/css" href="styles.css"><script src="/assets/js/jquery-1.8.2.min.js"></script><script src="/assets/js/jquery.PrintArea.js"></script><script src="/assets/js/jquery.jqprint.js"></script>' gi; subs_filter '<link href="/css/newcss/project.css" rel="stylesheet" type="text/css">' '<link href="/css/newcss/project.css" rel="stylesheet" type="text/css"><script src="/assets/js/jquery-1.8.2.min.js"></script><script src="/assets/js/jquery.PrintArea.js"></script><script src="/assets/js/jquery.jqprint.js"></script>' gi; subs_filter '<link href="/css/style.css" rel="stylesheet" type="text/css">' '<link href="/css/style.css" rel="stylesheet" type="text/css"><script src="/assets/js/jquery-1.8.2.min.js"></script><script src="/assets/js/jquery.PrintArea.js"></script><script src="/assets/js/jquery.jqprint.js"></script>' gi;
#学生中文成绩单打印页面添加高速打印功能 subs_filter '<form action="cj_zwcjd_all.jsp" method="post">' '<script>function webprint(){jQuery("table:first table:first").css("display","none");window.print();jQuery("table:first table:first").css("display","block");};jQuery(document).ready(function(){jQuery("table,tr,td").attr("align","center");jQuery("#report1 tr:first").css("height","50px");jQuery("#report1").css("width","720").css("margin-top","60").attr("cellpadding","5px");jQuery("table:first table:first a:last").after(" >> <a href=# onclick=webprint();return;>高速浏览器打印<\/a>");jQuery("div:contains(\"- - -\")").remove();});</script><form action="cj_zwcjd_all.jsp" method="post">' gi;
#教学记录表页面添加高速打印功能并设定打印效果 subs_filter '//new jw080724hnn' 'function webprint(){jQuery("form").css("display","none");jQuery("table:eq(5)").css("display","none");window.print();/*jQuery("table:eq(4)").jqprint();*/jQuery("form").css("display","inline");jQuery("table:eq(5)").css("display","block");}jQuery(document).ready(function(){jQuery("#report1").css("width","1000");jQuery("form table:eq(1)").attr("width","1000").attr("align","center");/*jQuery("select:first").attr("onchange","cx();");*/jQuery("select:first").after("<button onclick=cx();>查询</button>");jQuery("form").css("display","inline");jQuery("table:eq(3)").remove();jQuery(".report1_6_1").text("");jQuery("tr[height=20]:lt(2)").remove();jQuery("table:eq(5) a:last").after(" >> <a href=# onclick=webprint();return;>高速浏览器打印<\/a>");jQuery("div:contains(\"- - -\")").remove();});' gi;
#成绩分析页面添加高速打印功能并设定打印效果 subs_filter 'function report1_importExcel()' 'function webprint(){jQuery("table:first").css("display","none");window.print();jQuery("table:first").css("display","block");};jQuery(document).ready(function(){jQuery("table").attr("align","center");jQuery("tr[height=20]:last").remove();jQuery("tr[height=9]:last").remove();jQuery("#report1").css("width","640");jQuery("#report1_sub_8_1").css("width","640").css("border-right","1px solid");jQuery("img").css("width","638").css("height","160").css("border","1px solid");jQuery("#report1_sub_11_4").css("width","426");jQuery("#report1_sub_12_4").css("width","426");jQuery("#runqian_submit").after(" >> <a href=# onclick=webprint();return;>高速浏览器打印<\/a>");jQuery("div:contains(\"- - -\")").remove();});function report1_importExcel()' gi;
#打印成绩单页面添加高速打印功能并设定打印效果 #subs_filter '<tr height="20" style="height:20px;">(.*)</tr>' '' gir; #subs_filter ' <td class="report1_1_1"></td>' '' gi;
subs_filter 'function initialization(){' 'function webprint(){jQuery("form:first").css("display","none");jQuery("table:eq(2) table:first").css("display","none");window.print();jQuery("form:first").css("display","block");jQuery("table:eq(2) table:first").css("display","block");};jQuery(document).ready(function(){jQuery("tr[height=20]:lt(1)").remove();jQuery("table:first").attr("width","640");jQuery("#report1").css("width","640");jQuery("table:eq(2) a:last").after(" >> <a href=# onclick=webprint();return;>高速浏览器打印<\/a>");jQuery("div:contains(\"- - -\")").remove();});function initialization(){' gi;
subs_filter onClick="getType() onClick="window.open('/reportFiles/cj/cj_kccj.jsp','','height=800,width=750,toolbar=no,resizable=yes,menubar=yes,scrollbars=yes') gi; #历年成绩查询并添加高速打印功能、设定打印效果 subs_filter '<form action="/reportFiles/cj/xs_kccjb.jsp"' '<script>function webprint(){jQuery("form:first").css("display","none");jQuery("table:lt(2)").css("display","none");window.print();jQuery("form:first").css("display","block");jQuery("table:lt(2)").css("display","block");};jQuery(document).ready(function(){jQuery("table").attr("width","640").attr("align","center");jQuery("#report1").css("width","640");jQuery("table:eq(1) a:last").after(" >> <a href=# onclick=webprint();return;>高速浏览器打印<\/a>");jQuery("div:contains(\"- - -\")").remove();});</script><form action="/reportFiles/cj/xs_kccjb.jsp"' gi;
#教师课表、教室课表、班级课表添加高速打印功能并设定打印效果 subs_filter '<td colspan="9"> <p align="center" class="td2 style5">' '<td colspan="9"><p align="center" class="td2 style5">' gi; subs_filter 'function printkb()' 'function webprint(){jQuery("table:eq(16)").jqprint();};jQuery(document).ready(function(){jQuery("#btprint").parent().attr("width","200");jQuery("#btprint").after(" >> <a href=# onclick=webprint();return;>高速浏览器打印<\/a>");jQuery("div:contains(\"- - -\")").remove();});function printkb()' gi; #登录成绩添加自动填充功能 subs_filter 'height="400"' 'height="100%"' gi; subs_filter '<table width="640"' '<table width="100%"' gi; subs_filter '<form name="CjlrmxFrom" method="post" action="cjlrmxAction.do?actionType=1">' '<script src="/assets/js/autoscore.js"></script><form name="CjlrmxFrom" method="post" action="cjlrmxAction.do?actionType=1"><table width="100%"><tr><td><textarea class="manuscript" id="ss" rows=5 cols=20 style="width:100%;"></textarea></td></tr><tr><td><button onclick="autoscore();return false;">自动填充成绩</button> <button onclick="autoscorehelp();return false;">使用说明</button></td></tr><tr><td><div id="autoscoremsg" style="background:blue;color:white;padding:2px;2px;2px;2px;"></div></td></tr></table>' gi;
}
#一些静态资源比如jquery等不进行代理,使用本站提供,注意页面中一定使用 /assets/ 相对链接 location /assets/ { index index.php index.html; include fastcgi_params; root /data/www/zhjw.scse.hebut.edu.cn/htdocs/; }
#网站主页替换为本站 login.php ,这样可以自定义登录外观,可不替换。 location =/ { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://zhjw.scse.hebut.edu.cn/login.php; }
#顶部框架使用 top.php 替换 location /menu/top.jsp { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://zhjw.scse.hebut.edu.cn/top.php; }
#左侧框架使用menu.php替换,根据不同角色切换为不同菜单。 location /menu/menu.jsp { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://zhjw.scse.hebut.edu.cn/menu.php; }
#php 页面解析为本站解析 location ~ \.php$ { include fastcgi_params; fastcgi_index index.php; #fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_param SCRIPT_FILENAME /data/www/zhjw.scse.hebut.edu.cn/htdocs$fastcgi_script_name; } }
|