<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>proxy | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/proxy/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Thu, 19 Apr 2012 00:51:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Hosting multiple Express (node.js) apps on port 80</title>
		<link>https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/</link>
					<comments>https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/#comments</comments>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Fri, 20 Apr 2012 03:40:31 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Express]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[socket.io]]></category>
		<category><![CDATA[vServer]]></category>
		<category><![CDATA[express]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[sockets]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2144</guid>

					<description><![CDATA[<p>In the last days, i was trying to find a solution hosting multiple Express apps on my vServer the same Server. Starting with Apache and mod_proxy, i ended up with a plain node solution, which i really like. Let&#8217;s take a quick look on some different approaches out there: &#8212;1&#8212; Using apache on port 80 &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/" class="more-link">Continue reading<span class="screen-reader-text"> "Hosting multiple Express (node.js) apps on port 80"</span></a></p>
The post <a href="https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/">Hosting multiple Express (node.js) apps on port 80</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>In the last days, i was trying to find a solution hosting multiple <a href="http://expressjs.com/">Express</a> apps on <del datetime="2012-04-19T00:40:35+00:00">my vServer </del>the same Server.</p>
<p>Starting with <a href="http://www.apache.org/">Apache</a> and <a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html">mod_proxy</a>, i ended up with a plain node solution, which i really like.<span id="more-2144"></span></p>
<p><a href="https://nerdpress.org/wp-content/uploads/2012/04/node-http-proxy-haz-colors.png"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-2146" title="node-http-proxy-haz-colors" src="https://nerdpress.org/wp-content/uploads/2012/04/node-http-proxy-haz-colors.png" alt="" width="527" height="106" srcset="https://nerdpress.org/wp-content/uploads/2012/04/node-http-proxy-haz-colors.png 527w, https://nerdpress.org/wp-content/uploads/2012/04/node-http-proxy-haz-colors-300x60.png 300w" sizes="(max-width: 527px) 100vw, 527px" /></a></p>
<p>Let&#8217;s take a quick look on some different approaches out there:</p>
<p><strong>&#8212;1&#8212;</strong></p>
<p>Using apache on port 80 as a proxy</p>
<pre class="brush: bash; title: ; notranslate">
ProxyPass /nodeurls/ http://localhost:9000/
ProxyPassReverse /nodeurls/ http://localhost:9000/
</pre>
<p>via <a href="http://stackoverflow.com/questions/6109089/how-do-i-run-node-js-on-port-80">stackoverflow</a></p>
<p>&#8212; no websockets<br />
++ probably the easiest way to integrate with your running AMPP-stack</p>
<p><strong>&#8212;2&#8212;</strong></p>
<p>Using a node.js app on port 80 as a Wrapper for other node apps.</p>
<pre class="brush: jscript; title: ; notranslate">
express.createServer()
  .use(express.vhost('hostname1.com', require('/path/to/hostname1').app)
  .use(express.vhost('hostname2.com', require('/path/to/hostname2').app)
.listen(80)
</pre>
<p>via <a href="http://stackoverflow.com/questions/9332865/how-should-i-organize-multiple-express-servers-on-the-same-system">stackoverflow</a></p>
<p>++ you can use websockets on port 80<br />
&#8212; apps crash/restart/stop globally<br />
&#8211;what about your apache or the like?</p>
<p><strong>&#8212;3&#8212;</strong></p>
<p>Using node.js with node-http-proxy on port 80</p>
<pre class="brush: jscript; title: ; notranslate">
var http = require('http')
, httpProxy = require('http-proxy');

httpProxy.createServer({
  hostnameOnly: true,
  router: {
    //web-development.cc
    'www.my-domain.com': '127.0.0.1:3001',
    'www.my-other-domain.de' : '127.0.0.1:3002'
  }
}).listen(80);

</pre>
<p>++ proxy websockets to any port<br />
&#8212; you might need to move your old web server to another port</p>
<p>The really cool thing about using node-http-proxy is its capability of proxying websockets.<br />
So you can have your apps running independtly on different ports while serving everything to the user over port 80 and use stuff like <a href="http://socket.io/">socket.io</a>.</p>
<p>Since i&#8217;m new to node.js and miles away from beeing a admin, any feedback is highly appreciated :)</p>The post <a href="https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/">Hosting multiple Express (node.js) apps on port 80</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/feed/</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
			</item>
	</channel>
</rss>
