<!DOCTYPE html>
<html>
<head>
<title>Dani Cela's Blog</title>
<link href="/assets/application-9eacf8eb59237c4cb18567ed4b45b34a.css" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/application-6e72d2d9710413e05830d686696b7871.js" type="text/javascript"></script>
<meta content="authenticity_token" name="csrf-param" />
<meta content="ayYCAeUCByvbFPFotqmo+fWRXgdiQqbCpIC5SrHCExY=" name="csrf-token" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount','UA-37546142-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>

<!-- /%meta{ :name => 'viewport', :content => 'initial-scale=1, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0'} -->
<!-- /%meta{ :name => 'apple-mobile-web-app-capable', :content => 'yes' } -->
</head>
</html>
<body>
<div class='fb-root'></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<script>
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
</script>
<div id='content'>
<div id='header-container'>
<div id='logo-name'>
<a href="/" class="logo-link">DANI CELA</a>
<p class='logo-text'>A photography and IT blog</p>
</div>
<div id='nav'>
<ul>
<li>
<a href="/blog">BLOG</a>
</li>
<li>
<a href="/photos">PHOTOS</a>
</li>
<li>
<a href="/about">ABOUT</a>
</li>
<li>
<a href="/contact">CONTACT</a>
</li>
<li>
</li>
</ul>
</div>

</div>
<div class='container-type-1'>
<div class='main-view'>
<div class='post-object'>
<h2><a href="/blog_posts/2">NGINX proxy redirect for multiple unique domains</a></h2>
<p class='tag-list'>tags: <a href="/tags/NGINX">NGINX</a></p>
<!-- /%div.fb-like{"data-layout" => "button_count", "data-href" => "http://adamchow.ca"+blog_post_path(blog_post), "data-send" => "false", "data-show-faces" => "true", "data-width" => "500"} -->
<div class='post-content'>
<p><p>
	An issue that I have ran into numerous times in the past has been how to redirect multiple domains all to a single primary domain name. I decided it was finally time to document how this is done for my future reference and anyone else.</p>
<p>
	In your NGINX config file for your site this is the code that will do the magic:</p>
<pre>
server {

    listen       80;
    server_name  ...</p>
</div>
<a class='twitter-share-button' data-lang='en' href='https://twitter.com/share'>Tweet</a>
<div class='fb-like' data-href='http://127.0.0.1:2745/?feed=rss2/blog_posts/2' data-send='false' data-show-faces='true' data-width='500'></div>
</div>
<div class='post-object'>
<h2><a href="/blog_posts/3">Installing Ruby on Rails on Debian</a></h2>
<p class='tag-list'>tags: <a href="/tags/Debian">Debian</a>, <a href="/tags/Ruby%20on%20Rails">Ruby on Rails</a>, <a href="/tags/NGINX">NGINX</a></p>
<!-- /%div.fb-like{"data-layout" => "button_count", "data-href" => "http://adamchow.ca"+blog_post_path(blog_post), "data-send" => "false", "data-show-faces" => "true", "data-width" => "500"} -->
<div class='post-content'>
<p><h2>
	Download some packages</h2>
<pre>
apt-get update

apt-get upgrade

apt-get install build-essential zlib1g zlib1g-dev libreadline5 libssl-dev git-core curl bison openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev libcurl4-openssl-dev libopenssl-ruby apache2-prefork-dev libapr1-dev libaprutil1-dev libx...</p>
</div>
<a class='twitter-share-button' data-lang='en' href='https://twitter.com/share'>Tweet</a>
<div class='fb-like' data-href='http://127.0.0.1:2745/?feed=rss2/blog_posts/3' data-send='false' data-show-faces='true' data-width='500'></div>
</div>
<div class='post-object'>
<h2><a href="/blog_posts/4">Installing NGINX on Debian Squeeze</a></h2>
<p class='tag-list'>tags: <a href="/tags/Debian">Debian</a>, <a href="/tags/NGINX">NGINX</a></p>
<!-- /%div.fb-like{"data-layout" => "button_count", "data-href" => "http://adamchow.ca"+blog_post_path(blog_post), "data-send" => "false", "data-show-faces" => "true", "data-width" => "500"} -->
<div class='post-content'>
<p><p>
	One of the easiest ways to install NGINX is from Debian&#39;s package manager, but if you check the version you will notice it is pre 1.x.&nbsp;</p>
<p>
	A very easy way to get the latest NGINX version installed is by using NGINX&#39;s source servers.</p>
<p>
	&nbsp;</p>
<p>
	First add the following lines to your /etc/apt/sources.list file</p>
<pre>
deb http://nginx.org/packages/d...</p>
</div>
<a class='twitter-share-button' data-lang='en' href='https://twitter.com/share'>Tweet</a>
<div class='fb-like' data-href='http://127.0.0.1:2745/?feed=rss2/blog_posts/4' data-send='false' data-show-faces='true' data-width='500'></div>
</div>
<div class='post-object'>
<h2><a href="/blog_posts/5">SSH - Remote Host Identification Changed - FIX</a></h2>
<p class='tag-list'>tags: <a href="/tags/SSH">SSH</a>, <a href="/tags/UNIX">UNIX</a></p>
<!-- /%div.fb-like{"data-layout" => "button_count", "data-href" => "http://adamchow.ca"+blog_post_path(blog_post), "data-send" => "false", "data-show-faces" => "true", "data-width" => "500"} -->
<div class='post-content'>
<p><p>
	Often times when reimaging a current server the ssh key will change and you will get a similar message to the following:</p>
<p>
	&nbsp;</p>
<p>
	The easiest way to solve this is to issue the following command:</p>
<pre>
ssh-keygen -R HOSTNAME/IP</pre>
<p>
	This will remove the record from the ssh file without you having to remove the entire known_hosts file.</p>
<p>
	&nbsp;</p>...</p>
</div>
<a class='twitter-share-button' data-lang='en' href='https://twitter.com/share'>Tweet</a>
<div class='fb-like' data-href='http://127.0.0.1:2745/?feed=rss2/blog_posts/5' data-send='false' data-show-faces='true' data-width='500'></div>
</div>
<div class="pagination"><span class="previous_page disabled">&#8592; Previous</span> <em class="current">1</em> <a rel="next" href="/?feed=rss2&amp;page=2">2</a> <a class="next_page" rel="next" href="/?feed=rss2&amp;page=2">Next &#8594;</a></div>
</div>
<div class='sidebar'>
<div class='search-bar'>
<form accept-charset="UTF-8" action="#" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
<div id='input-border'>
<div id='input-text-box'>
<input id="search" name="search" type="text" />
</div>
</div>
<input class="search-submit" type="submit" value="search" />
</form>

</div>
<h3>Categories:</h3>
<ul>
<li>
<a href="/tags/SSH">SSH</a>
</li>
<li>
<a href="/tags/Ruby%20on%20Rails">Ruby on Rails</a>
</li>
<li>
<a href="/tags/Debian">Debian</a>
</li>
<li>
<a href="/tags/PostgreSQL">PostgreSQL</a>
</li>
<li>
<a href="/tags/UNIX">UNIX</a>
</li>
<li>
<a href="/tags/NGINX">NGINX</a>
</li>
</ul>
<h3>Popular Topics:</h3>
<div class='tag-cloud'>
<a href="/tags/SSH" class="m">SSH</a>
<a href="/tags/Ruby%20on%20Rails" class="m">Ruby on Rails</a>
<a href="/tags/Debian" class="m">Debian</a>
<a href="/tags/PostgreSQL" class="m">PostgreSQL</a>
<a href="/tags/UNIX" class="m">UNIX</a>
<a href="/tags/NGINX" class="l">NGINX</a>
</div>
</div>

</div>


<div style='clear:both;'></div>
</div>
</body>
