File: nsvhr.html

package info (click to toggle)
aolserver-nsvhr 1.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 56 kB
  • ctags: 52
  • sloc: ansic: 404; makefile: 53
file content (89 lines) | stat: -rw-r--r-- 3,234 bytes parent folder | download
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
<html>
<head>
  <title>nsvhr</title>
</head>
<body bgcolor="#ffffff">
<h2>nsvhr -- Virtual Hosting Redirector Module</h2>
<pre>$Header: /cvsroot/aolserver/nsvhr/nsvhr.html,v 1.1.1.1 2001/01/31 21:01:56 kriston Exp $
</pre>
<br>
<a href="#Theory_of_Operation">Theory of Operation</a><br>
<a href="#Known_Issues">Known Issues</a><br>
<a href="#Sample_Configuration">Sample Configuration</a><br>
<br>
<br>
<h3><a name="Theory_of_Operation"></a>Theory of Operation</h3>
Despite its name, the nsvhr module is a proxy that connects to remote hosts
 depending on the "Host:" header presented by the client.&nbsp; It can connect
 to these remote hosts using <a href="../nssock/nssock.html">nssock</a>or <a href="../nsunix/nsunix.html">nsunix</a>.<br>
<br>
<h3><a name="Known_Issues"></a>Known Issues</h3>
On the proxied remote host, commands like [ns_conn location] might be misleading.<br>
<br>
It's not clear whether the "Host:" header is properly rewritten for the remote
 host.<br>
<br>
The code that processes the "Host:" header from the client is unsmart.<br>
<br>
Users seem to habitually confuse nsvhr with the old AOLserver 2.x Virtual
 Hosting feature.&nbsp; These are completely different concepts that have little
 to do with each other.&nbsp; The sole purpose of nsvhr is to <b>proxy </b>connections
 to other servers based on the "Host:" header presented by the client.&nbsp; <i>The
 nsvhr module is not designed for in-process virtual hosting a la AOLserver
 2.x.</i><br>
<br>
<h3><a name="Sample_Configuration"></a>Sample Configuration</h3>
<br>
Proxying via tcp (the default) is very simple to set up.&nbsp; No special<br>
modules need to be loaded (it uses the already-loaded nssock).&nbsp; It is<br>
less efficient than nsunix and but is the preferred method to<br>
communicate with web servers on a different machine.<br>
<br>
Proxying over a unix domain socket requires loading the nsunix.so<br>
module.&nbsp; Proxying this way is more efficient since the file descriptor<br>
of the socket of the incoming connection is passed to nsunix.so in a<br>
message over the unix domain socket.&nbsp; Then the client communicates<br>
directly with the nsunix.so module and this module is no longer<br>
involved.&nbsp; This is the preferred method to proxy to web servers<br>
running on the same machine.
<pre>
# 
# Virtual Hosting redirector -- nsvhr 
# 
ns_section "ns/server/${servername}/module/nsvhr" 
ns_param   busyurl         "url"     ;# Redirect here if back-end times out 
ns_param   errorurl        "url"     ;# Redirect here on proxy errors 
ns_param   method          "GET"     ;# Methods allowed to proxy 
ns_param   method          "POST"    ;# Methods allowed to proxy (can have &gt;1) 
ns_param   timeout         30        ;# Timeout waiting for back-end 
 
# Register hosts to proxy 
ns_section "ns/server/${servername}/module/nsvhr/maps" 
ns_param   "www.tcpsocket.com"    "http://127.0.0.0:2000" ;# HTTP proxy 
ns_param   "www.domainsocket.com" "unix://somehost"       ;# Domain socket 

</pre>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>