Доброго времени суток господа!
Работаю в телеком компании. Есть корп.сеть и сеть состоящая и овер дохрена всякого оборудования.В сети штук 500 оптических приемников которые могут управляться только через вебморду. Есть сервер который живет и в сети оборудования и в корп. сети, на сервере крутится сайтик для мониторинга оборудования.
Задача сделать доступными веб-морды приемников с сайтика.
Решил использовать для этого уже установленный и работающий nginx. Дописал в конфиг вот это:
location ~ "/cybertron/op/(10\.22[0-2]\.[0-9]{0,3}\.[0-9]{0,3})/*(.*)"{
proxy_pass http://$1/$2;
proxy_http_version 1.1;
proxy_set_header Connection keep-alive;
}
Вот весь конфиг:
server {
listen 80;
server_name 10.220.127.243;
access_log /var/log/nginx/10.220.127.243-acc;
error_log /var/log/nginx/10.220.127.243-err;
root /mnt/data/http/cybertron/www;
location ~ ^/redqueen {
proxy_pass http://10.220.127.243;
proxy_set_header Host redqueen;
proxy_set_header X-Real-IP $remote_addr;
}
location /phpMyAdmin {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param SCRIPT_FILENAME /mnt/data/http/cybertron/www$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/cybertron/static {
gzip_static on;
}
location ~ "/cybertron/op/(10\.22[0-2]\.[0-9]{0,3}\.[0-9]{0,3})/*(.*)"{
proxy_pass http://$1/$2;
proxy_http_version 1.1;
proxy_set_header Connection keep-alive;
}
location ~ \.ico$ { }
location ~ \.zip$ { }
location ~ \.css$ { }
location ~ \.jpg$ { }
location ~ \.png$ { }
location ~ \.gif$ { }
location ~ \.js$ { }
location ~ \.gz$ { }
# fonts
location ~ \.eot$ { }
location ~ \.ttf$ { }
location ~ \.svg$ { }
location ~ \.woff$ { }
location ~ \.woff2$ { }
location ~ ^/cybertron {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /mnt/data/http/cybertron/www/core.php;
include fastcgi_params;
}
location / {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /mnt/data/http/cybertron/www/core.php;
include fastcgi_params;
}
}
Проблемы с которыми столкнулся: 1.У некоторых железок стоит модный
HTTP-EQUIV="REFRESH" CONTENT="1; URL=/welcome.html"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang=en lang=en><head><title>Login page</title><script language=javascript src="script/include.js"></script><meta http-equiv=content-type content="text/html; charset=UTF-8"/><style> div.jsno {
color: red;
font-size:200%;
width:100%;
height:100%;
background-color:yellow;
text-align: center;
vertical-align: middle;
z-index: 90;border:1px solid;
border-color:black;
position:absolute;
top: 0px;
}
</style><script type="text/javascript">
function debugprint(){}
</script></head><body><style>
#welcome {
position: absolute;
top: 50%;
left: 50%;
}
#welcome_inner {
position: relative;
top: -70px;
}
#welcome_inner2 {
position: relative;
left: -50%;
width: 400px;
}
</style><!--[if lte IE 7]><style>
div.logo_leftup {
margin-left: 75px;
}
div.logo_leftdn {
margin-left: 66px;
}
</style><![endif]--><noscript><div class=jsno>Turn JavaScript on!</div></noscript><div class=gradient><div class=top><div class=logo><div width=320px height=110px><img id=logo_image alt="Planar logo"></img></div><a href="http
lazy.imgOnLoad = function() { LoginLock(false); }
lazy.include("design/device.css");
lazy.include("script/com_request.js");
//lazy.include("script/checks.js");
lazy.include("script/welcome.js");
//lazy.include("design/logo.gif", o("loading") );
o("logo_image").src = "design/head_logo.gif";
</script></body></html>[!http]
var global_var=0,lazy={context:this,jsExecute:function(a){"undefined"!=typeof execScript?execScript(a):lazy.context.eval?lazy.context.eval(a):eval(a);return null},cssExecute:function(a){var b=lazy.context.document.createElement("style");b.setAttribute("type","text/css");try{b.innerHTML=a}catch(c){b.styleSheet.cssText=a}lazy.context.document.getElementsByTagName("head")[0].appendChild(b);return b},getXHTTPTransport:function(){for(var a=!1,b=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},
function(){return new ActiveXObject("Microsoft.XMLHTTP")}],c=0;c<b.length;c++)try{a=b[c]();break}catch(d){}return a},loadedModules:{},module:function(a){lazy.loadedModules[a]=!0},include:function(a){if(lazy.loadedModules[a]&&!0==lazy.loadedModules[a])return!1;var b=lazy.getXHTTPTransport();b.open("GET","http://"+document.domain+("80"!=document.location.port?":"+document.location.port:"")+"/"+a,!1);b.send(null);return 200!=b.status?null:/\.js$/.test(a)?lazy.jsExecute(b.responseText):/\.css$/.test(a)?
lazy.cssExecute(b.responseText):null}};
2. У других железок какая проблема в том что в src или href указано допустим 5_scripts.js а в дампе видно что запрос идет на /cybertron/op/5_scripts Вот страничка html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><meta http-equiv="content-type" content="text/html; charset=iso-8859-2"/><title>Lambda PRO 72</title><link rel="stylesheet" type="text/css" href="7_styles.css"/><link href="favicon.ico" rel="shortcut icon" type="image/x-icon"/><script type="text/javascript" src="5_scripts.js"></script><script type="text/javascript">window.onload=function(){f2("vYA","vYB","vYL","vYM","1","vU ");}</script></head>
<!--head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-2"/>
<title>vYt</title>
<link rel="stylesheet" type="text/css" href="7_styles.css"/>
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon"/>
<script type="text/javascript" src="5_scripts.js"></script>
<script type="text/javascript">window.onload=function(){f2("vYA","vYB","vYL","vYM","vYt","vU ");}</script>
</head-->
<body style="visibility:hidden">
<table id="n">
<!--tr>
<td class="lo" width="977px" colspan=4>
<a class="lo" href="0_set.htm" onclick="clearAuthenticationCache('0_set.htm')">Logout</a>
</td>
</tr-->
<tr>
<td class="w"><a href="http://www.vector.com.pl"><img src="8_logo.jpg"/></a></td>
<td class="w" width="210px"> </td>
<td width="210px"><span>Node setup</span></td>
<td width="210px"><a href="3_admin.htm">Transponder setup</a></td>
</tr>
</table>
<table id="c">
<tr>
<form action="0_set.htm" name="fr">
<td class="l">
<div style="height:350px;"> </div>
<div id="d1"><img src="LP_72.png"/></div>
<div id="d2" style="display:vYR"><select name="b"><option value="D" selected>prefer A<option value="B" >force A<option value="C" >force B</select></div><div id="d8"><select name="V"><option value="@" >on<option value="V" >20 dB<option value="U" >19 dB<option value="T" >18 dB<option value="S" >17 dB<option value="R" >16 dB<option value="Q" >15 dB<option value="P" >14 dB<option value="O" >13 dB<option value="N" >12 dB<option value="M" >11 dB<option value="L" >10 dB<option value="K" >9 dB<option value="J" >8 dB<option value="I" >7 dB<option value="H" >6 dB<option value="G" >5 dB<option value="F" >4 dB<option value="E" >3 dB<option value="D" >2 dB<option value="C" >1 dB<option value="B" >off</select></div>
<!--div id="d2" style="display:vYR">
<select name="b">
<option value="D" sAD>prefer A
<option value="B" sAB>force A
<option value="C" sAC>force B
</select></div>
<div id="d8">
<select name="V">
<option value="@" sV@>on
<option value="V" sVV>20dB
<option value="U" sVU>19dB
<option value="T" sVT>18dB
<option value="S" sVS>17dB
<option value="R" sVR>16dB
<option value="Q" sVQ>15dB
<option value="P" sVP>14dB
<option value="O" sVO>13dB
<option value="N" sVN>12dB
<option value="M" sVM>11dB
<option value="L" sVL>10dB
<option value="K" sVK>9dB
<option value="J" sVJ>8dB
<option value="I" sVI>7dB
<option value="H" sVH>6dB
<option value="G" sVG>5dB
<option value="F" sVF>4dB
<option value="E" sVE>3dB
<option value="D" sVD>2dB
<option value="C" sVC>1dB
<option value="B" sVB>off
</select></div-->
<div id="d6"><input class ="intext" id="i1a" maxlength="2" size="1" name="H1" value=""/><font size="1">dB</font></div>
<!--div id="da"><input id="i20" maxlength="2" size="1" name="H5" value=""/><font size="1">dB</font></div-->
<div id="dd"></div><div id="dA"></div><div id="dE"></div><div id="dF"></div>
<table>
<tr>
<td class="pc">
<table class="p p2">
<tr><th colspan="3">Power supply</th></tr>
<tr class="o"><td>6V</td><td class="cr"><span id="p01">.</span></td><td>V</td></tr>
<tr><td>12.4V</td><td class="cr"><span id="p03">.</span></td><td>V</td></tr>
</table>
</td>
<tr></table>
</td>
<td class="pc">
<!-- ZAWARTOSC TABELI ZALEZY OD TYPU LP71 / LP72 -->
<table class="p p3">
<tr><th colspan="3">Lambda PRO 72, s/n: 000000802690<!--vYt, s/n: vYs--></th></tr>
<tr class="o"><td>Firmware</td><td><span>1.4.0</span></td>
<tr><td>Temperature</td><td class="cl"><span id="p24">.</span> °C</td>
<tr class="o"><td>Ext. port A</td><td><span id="p26">.</span></td><tr><td>Ext. port B</td><td><span id="p27">.</span></td><tr id="r1rh"><td class="h" colspan="3">Forward receivers</td><tr id="r1r1" class="o"><td>RX power A</td><td class="cl"><span id="p0a">.</span> dBm</td></tr><tr id="r2r1"><td>RX power B</td><td class="cl"><span id="p0b">.</span> dBm</td></tr><tr id="abrh"><td class="h" colspan="3">Extended AB switch configuration</td></tr><tr id="abr1"><td>Active input</td><td><span id="p15">.</span></td><tr id="abr2" class="o"><td>Lower threshold</td><td class="cl"><input class ="intext" id="i16" maxlength="5" size="1" name="H7" value=""/> dBm</td></tr><tr id="abr3"><td>Upper threshold</td><td class="cl"><input class ="intext" id="i17" maxlength="5" size="1" name="H8" value=""/> dBm</td></tr>
<!--tr class="o"><td>Ext. port A</td><td><span id="p26">.</span></td>
<tr><td>Ext. port B</td><td><span id="p27">.</span></td-->
<!--tr id="r1rh"><td class="h" colspan="3">Forward receiver</td>
<tr id="r1r1" class="o"><td>RX power A</td><td class="cl"><span id="p0a">.</span> dBm</td></tr-->
<!--tr id="r1rh"><td class="h" colspan="3">Forward receivers</td>
<tr id="r1r1" class="o"><td>RX power A</td><td class="cl"><span id="p0a">.</span> dBm</td></tr>
<tr id="r2r1"><td>RX power B</td><td class="cl"><span id="p0b">.</span> dBm</td></tr>
<tr id="abrh"><td class="h" colspan="3">Extended AB switch configuration</td></tr>
<tr id="abr1"><td>Active input</td><td><span id="p15">.</span></td>
<tr id="abr2" class="o"><td>Lower threshold</td><td class="cl"><input class ="intext" id="i16" maxlength="5" size="1" name="H7" value=""/> dBm</td></tr>
<tr id="abr3"><td>Upper threshold</td><td class="cl"><input class ="intext" id="i17" maxlength="5" size="1" name="H8" value=""/> dBm</td></tr-->
<tr><td class="h" colspan="3">Output monitoring</td></tr>
<tr><td>Output Level</td><td class="cl"><span id="p28">.</span> dBm</td></tr>
<tr class="o"><td>Reference level</td><td class="cl"><input class ="intext" id="i29" maxlength="3" size="1" name="H6"/> dBm</td></tr>
<tr><td>Delta</td><td class="cl"><span id="p2a">.</span> dBm</td></tr>
</table>
</td></form></tr>
<tr class="o">
<td colspan="4" style="text-align:right; padding:5px;">
<span id="b4" style="visibility:hidden;background:#ffcc00;padding:5px">Node configuration in progress, please wait...</span>
<input id="b1" type="button" value="SET" onclick="doSet()" style="display:vYS" enabled>
<input id="b2" type="button" value="REFRESH" onclick="JavaScript:document.location.assign('0_set.htm')">
<input id="b3" type="button" onclick="window.print()" value="PRINT">
</td></tr>
<tr><td class="f" colspan="4">© 2012 <b><a href="http://www.vector.com.pl">VECTOR</a></b></td></tr>
</table>
</body>
</html>
3. Третий тип умеет keep-alive(в отличии от остальных) но почему то висит долгое время открытым, в дампе нет http ответа вообще, но каким то образом видно окно входа в веб интерфейс.
P.S. Опыта в подобных вещах мало, подскажите пожалуйста если я несу бред и все решается проще