1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
4 Copyright (C) 2006-2008 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 NGINX Web Server Management Control
8 Ofer Chen (roadkill AT tomatoraf dot com)
9 Vicente Soriano (victek AT tomatoraf dot com)
10 Copyright (C) 2013 http://www.tomatoraf.com
12 For use with Tomato Firmware only.
13 No part of this file can be used or modified without permission.
17 <meta http-equiv='content-type' content='text/html;charset=utf-
8'
>
18 <meta name='robots' content='noindex,nofollow'
>
19 <title>[<%
ident(); %>] Web Server Menu
</title>
20 <link rel='stylesheet' type='text/css' href='tomato.css'
>
21 <link rel='stylesheet' type='text/css' href='color.css'
>
22 <script type='text/javascript' src='tomato.js'
></script>
26 <style type='text/css'
>
34 <script type='text/javascript' src='debug.js'
></script>
35 <script type='text/javascript'
>
37 // <% nvram("nginx_enable,nginx_keepconf,nginx_port,nginx_fqdn,nginx_docroot,nginx_priority,nginx_custom"); %>
40 nginxup
= parseInt ('<% psup("nginx"); %>');
42 function toggle(service
, isup
)
45 if (!confirm("Unsaved changes will be lost. Continue anyway?")) return;
47 E('_' + service
+ '_button').disabled
= true;
48 form
.submitHidden('/service.cgi', {
49 _redirect
: 'nginx.asp',
50 _sleep
: ((service
== 'nginxfp') && (!isup
)) ? '10' : '5',
51 _service
: service
+ (isup
? '-stop' : '-start')
55 function verifyFields(focused
, quiet
)
61 _f_nginx_keepconf
: 1,
65 _f_nginx_priority
: 1,
69 if (!E('_f_nginx_enable').checked
) {
78 b
.disabled
= (c
!= 1);
79 PR(b
).style
.display
= c
? '' : 'none';
82 if (!v_port('_f_nginx_port', quiet
))
88 if ((!v_length('_f_nginx_docroot', quiet
, 1, 255)) || (!v_length('_f_nginx_fqdn', quiet
, 1, 255)) || (!v_length('_f_nginx_custom', quiet
, 1, 4096)))
101 if (!verifyFields(null, false)) return;
103 var en
= fom
.f_nginx_enable
.checked
;
104 fom
.nginx_enable
.value
= en
? 1 : 0;
107 fom
.nginx_keepconf
.value
= fom
.f_nginx_keepconf
.checked
? 1 : 0;
108 fom
.nginx_port
.value
= fom
.f_nginx_port
.value
;
109 fom
.nginx_fqdn
.value
= fom
.f_nginx_fqdn
.value
;
110 fom
.nginx_docroot
.value
= fom
.f_nginx_docroot
.value
;
111 fom
.nginx_priority
.value
= fom
.f_nginx_priority
.value
;
112 fom
.nginx_custom
.value
= fom
.f_nginx_custom
.value
;
116 fom
._service
.value
= 'enginex-stop';
118 fom
._service
.value
= 'enginex-restart';
126 <form id='_fom' method='post' action='tomato.cgi'
>
127 <table id='container' cellspacing=
0>
128 <tr><td colspan=
2 id='header'
>
129 <div class='title'
>Tomato RAF
</div>
130 <div class='version'
>Version <%
version(); %></div>
132 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
134 <div id='ident'
><%
ident(); %></div>
137 <div class='section-title'
>Status
</div>
138 <div class='section' id='status-section'
>
139 <script type='text/javascript'
>
140 W('NGINX is currently '+(!nginxup
? 'stopped' : 'running')+' ');
141 W('<input type="button" value="' + (nginxup
? 'Stop' : 'Start') + ' Now" onclick="toggle(\'nginxfp\', nginxup)" id="_nginxfp_button">');
147 <div class='section-title'
>WEB Server Settings
</div>
148 <div class='section' id='config-section'
>
149 <form id='_fom' method='post' action='tomato.cgi'
>
150 <input type='hidden' name='_nextpage' value='nginx.asp'
>
151 <input type='hidden' name='_service' value='enginex-restart'
>
152 <input type='hidden' name='_nextwait' value='
10'
>
153 <input type='hidden' name='_reboot' value='
0'
>
155 <input type='hidden' name='nginx_enable'
>
156 <input type='hidden' name='nginx_keepconf'
>
157 <input type='hidden' name='nginx_port'
>
158 <input type='hidden' name='nginx_fqdn'
>
159 <input type='hidden' name='nginx_docroot'
>
160 <input type='hidden' name='nginx_priority'
>
161 <input type='hidden' name='nginx_custom'
>
163 <script type='text/javascript'
>
164 createFieldTable('', [
165 { title
: 'Enable Server on Start', name
: 'f_nginx_enable', type
: 'checkbox', value
: (nvram
.nginx_enable
!= '0') },
166 { title
: 'Keep Config Files', name
: 'f_nginx_keepconf', type
: 'checkbox', value
: (nvram
.nginx_keepconf
!= '0') },
167 { title
: 'Web Server Port', name
: 'f_nginx_port', type
: 'text', maxlen
: 5, size
: 7, value
: fixPort(nvram
.nginx_port
, 85), suffix
: '<small> default: 85</small>' },
168 { title
: 'Web Server Name', name
: 'f_nginx_fqdn', type
: 'text', maxlen
: 255, size
: 20, value
: nvram
.nginx_fqdn
},
169 { title
: 'Server Root Path', name
: 'f_nginx_docroot', type
: 'text', maxlen
: 255, size
: 40, value
: nvram
.nginx_docroot
, suffix
: '<span> /index.html / index.htm / index.php</span>' },
170 { title
: 'Server Priority', name
: 'f_nginx_priority', type
: 'text', maxlen
: 8, size
:3, value
: nvram
.nginx_priority
, suffix
:'<small> Max. Perfor: -20, Min.Perfor: 19, default: 10</small>' },
171 { title
: '<a href="http://wiki.nginx.org/Configuration" target="_new">NGINX</a><br>Custom configuration', name
: 'f_nginx_custom', type
: 'textarea', value
: nvram
.nginx_custom
}
179 <span style='color:blue'
>
180 <b>User Manual.
</b><br>
182 <li><b>Note: This Feature is in Beta test, please test and report any bug you may find.
</b>
185 <li><b> Status Button:
</b> Quick Start-Stop Service. Enable Web Server must be checked to modify settings.
<br>
186 <li><b> Enable Server on Start:
</b> To activate the Web Server tick and save this screen.
<br>
187 <li><b> Keep Config Files:
</b> Did you modifed manualy the configuration files? OK, Tick it and changes will be maintained.
<br>
188 <li><b> Web Server Port:
</b> The Port used by the Web Server to be accessed.
<br>
189 <li><b> Web Server Name:
</b> Name that will appear on top of your Internet Browser.
<br>
190 <li><b> Document Root Path:
</b> The path in your router where documents are stored.
<br>
191 <li><b> Examples:
<br></b>
192 /tmp/mnt/HDD/www/ as you can find in USB mount path.
<br>
193 <li><b> NGINX Custom Configuration:
</b> You can add other values to nginx.conf to suit your needs.
<br>
195 <span style='color:blue'
>
196 <li><b> Server Priority:
</b> Sets the service priority over other processes running on the router.
<br><br>
197 The operating system kernel has priority -
5.
<br>
198 Never select a lower value than the kernel uses. Do not use the service test page to adjust the
<br>
199 server performance, it's performance is lower than the definitive media where files will be
<br>
200 located, i.e; USB Stick, Hard Drive or SSD.
<br>
208 <tr><td id='footer' colspan=
2>
209 <span id='footer-msg'
></span>
210 <input type='button' value='Save' id='save-button' onclick='save()'
>
211 <input type='button' value='Cancel' id='cancel-button' onclick='javascript:reloadPage();'
>
215 <script type='text/javascript'
>verifyFields(null, 1);</script>