<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Website on Janik von Rotz</title>
    <link>https://janikvonrotz.ch/tags/website/</link>
    <description>Recent content in Website on Janik von Rotz</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Wed, 02 Apr 2014 06:52:03 +0000</lastBuildDate>
    <atom:link href="https://janikvonrotz.ch/tags/website/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Node.js Nginx proxy website</title>
      <link>https://janikvonrotz.ch/2014/04/02/node-js-nginx-proxy-website/</link>
      <pubDate>Wed, 02 Apr 2014 06:52:03 +0000</pubDate>
      <guid>https://janikvonrotz.ch/2014/04/02/node-js-nginx-proxy-website/</guid>
      <description>&lt;p&gt;&lt;em&gt;This post is part of my &lt;a href=&#34;https://janikvonrotz.ch/your-own-virtual-private-server-hosting-solution/&#34;&gt;Your own Virtual Private Server hosting solution&lt;/a&gt; project.&lt;/em&gt;&lt;br&gt;&#xA;&lt;em&gt;Get the latest version of this article here: &lt;a href=&#34;https://gist.github.com/9407504&#34;&gt;https://gist.github.com/9407504&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;introduction&#34;&gt;Introduction&lt;/h1&gt;&#xA;&lt;p&gt;It&amp;rsquo;s recommanded to publish a Node.js application with a Nginx proxy website.&lt;/p&gt;&#xA;&lt;h1 id=&#34;requirements&#34;&gt;Requirements&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://janikvonrotz.ch/2014/03/13/deploy-ubuntu-server/&#34;&gt;Ubuntu server&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://janikvonrotz.ch/2014/03/27/install-node/&#34;&gt;Node.js&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://janikvonrotz.ch/2014/03/31/install-nginx/&#34;&gt;Nginx&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://janikvonrotz.ch/2014/04/01/nginx-minimal-website/&#34;&gt;Nginx minimal website&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1 id=&#34;installation&#34;&gt;Installation&lt;/h1&gt;&#xA;&lt;p&gt;Add this Nginx config to one of your website.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;server {&#xA;&#xA;    location / {&#xA;        proxy_set_header X-Real-IP $remote_addr;&#xA;        proxy_set_header Host $http_host;&#xA;        proxy_pass http://127.0.0.1:[port];&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Where &lt;code&gt;proxy_pass&lt;/code&gt; port is the must be equal with the port of the Node.js application.&lt;/p&gt;&#xA;&lt;p&gt;Restart the Nginx service.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo service nginx restart&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Nginx minimal website</title>
      <link>https://janikvonrotz.ch/2014/04/01/nginx-minimal-website/</link>
      <pubDate>Tue, 01 Apr 2014 07:57:42 +0000</pubDate>
      <guid>https://janikvonrotz.ch/2014/04/01/nginx-minimal-website/</guid>
      <description>&lt;p&gt;&lt;em&gt;This post is part of my &lt;a href=&#34;https://janikvonrotz.ch/your-own-virtual-private-server-hosting-solution/&#34;&gt;Your own Virtual Private Server hosting solution&lt;/a&gt; project.&lt;/em&gt;&lt;br&gt;&#xA;&lt;em&gt;Get the latest version of this article here: &lt;a href=&#34;https://gist.github.com/9408741&#34;&gt;https://gist.github.com/9408741&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;introduction&#34;&gt;Introduction&lt;/h1&gt;&#xA;&lt;p&gt;This is a minimal Nginx website configuration. It&amp;rsquo;s a good way to start your next project.&lt;/p&gt;&#xA;&lt;h1 id=&#34;requirements&#34;&gt;Requirements&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://janikvonrotz.ch/2014/03/13/deploy-ubuntu-server/&#34;&gt;Ubuntu server&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://janikvonrotz.ch/2014/03/31/install-nginx/&#34;&gt;Nginx&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1 id=&#34;installation&#34;&gt;Installation&lt;/h1&gt;&#xA;&lt;p&gt;Add this configuration file to the config folder &lt;code&gt;/etc/nginx/conf.d&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo vi /etc/nginx/conf.d/[host].conf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;With the content showed below.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;server{&#xA;&#xA;    listen 80;&#xA;    server_name [host]&#xA;&#xA;    root /var/www/[host];&#xA;    index index.php index.html;&#xA;&#xA;    # host error and access log&#xA;    access_log /var/log/nginx/[host].access.log;&#xA;    error_log /var/log/nginx/[host].error.log;&#xA;    &#xA;    location / {&#xA;    }&#xA;    &#xA;    # redirect server error pages to the static page /50x.html&#xA;    error_page   500 502 503 504  /50x.html;&#xA;    location = /50x.html {&#xA;        root   /usr/share/nginx/html;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Update permissions for the &lt;code&gt;www-data&lt;/code&gt; group.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo chown www-data:www-data /var/www/[host] -R &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Test config and reload Nginx service.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo nginx -t &amp;amp;&amp;amp; sudo service nginx reload&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
  </channel>
</rss>
