<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Avinash Sharma</title>
    <description>The latest articles on DEV Community by Avinash Sharma (@avinashsharma).</description>
    <link>https://dev.to/avinashsharma</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F475033%2F8f1b247f-9c1b-4cc6-858f-3c6731d6d609.jpeg</url>
      <title>DEV Community: Avinash Sharma</title>
      <link>https://dev.to/avinashsharma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/avinashsharma"/>
    <language>en</language>
    <item>
      <title>How to configure Nginx configuration file in ubuntu for localhost port forwarding</title>
      <dc:creator>Avinash Sharma</dc:creator>
      <pubDate>Tue, 18 May 2021 19:12:07 +0000</pubDate>
      <link>https://dev.to/avinashsharma/how-to-configure-nginx-configuration-file-in-ubuntu-for-localhost-port-forwarding-1hlj</link>
      <guid>https://dev.to/avinashsharma/how-to-configure-nginx-configuration-file-in-ubuntu-for-localhost-port-forwarding-1hlj</guid>
      <description>&lt;h1&gt;
  
  
  &lt;code&gt;First&lt;/code&gt;
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..
&lt;span class="nb"&gt;cd &lt;/span&gt;etc/nginx/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This takes you to the root dir of the Nginx server&lt;br&gt;
then&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;sites-available
vim YourSiteName
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;server &lt;span class="p"&gt;{&lt;/span&gt;
        listen &lt;span class="m"&gt;3000&lt;/span&gt; default_server;
        listen &lt;span class="p"&gt;[::]:&lt;/span&gt;&lt;span class="m"&gt;3000&lt;/span&gt; default_server;

        root &lt;span class="sr"&gt;/var/&lt;/span&gt;www/html;
        &lt;span class="nb"&gt;index&lt;/span&gt; &lt;span class="nb"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;html &lt;span class="nb"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;htm &lt;span class="nb"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;nginx&lt;span class="p"&gt;-&lt;/span&gt;debian&lt;span class="p"&gt;.&lt;/span&gt;html;

        server_name _;

        location / &lt;span class="p"&gt;{&lt;/span&gt;
                try_files $uri $uri/ &lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;404&lt;/span&gt;;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To save and exit from the vim use this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;:wq
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, We want to update the sites-enabled dir&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..
&lt;span class="nb"&gt;cd &lt;/span&gt;sites-enabled/
vim YourSiteName
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;server &lt;span class="p"&gt;{&lt;/span&gt;
        listen &lt;span class="m"&gt;3000&lt;/span&gt; default_server;
        listen &lt;span class="p"&gt;[::]:&lt;/span&gt;&lt;span class="m"&gt;3000&lt;/span&gt; default_server;

        root &lt;span class="sr"&gt;/var/&lt;/span&gt;www/html;
        &lt;span class="nb"&gt;index&lt;/span&gt; &lt;span class="nb"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;html &lt;span class="nb"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;htm &lt;span class="nb"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;nginx&lt;span class="p"&gt;-&lt;/span&gt;debian&lt;span class="p"&gt;.&lt;/span&gt;html;

        server_name _;

        location / &lt;span class="p"&gt;{&lt;/span&gt;
                try_files $uri $uri/ &lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;404&lt;/span&gt;;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, Rur your project/application and forward the port.&lt;br&gt;
In the given example the defeat port is 3000.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd
cd &lt;/span&gt;yourProject 
npx http-server &lt;span class="nt"&gt;-p&lt;/span&gt; 3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check out more on in-depth guide through &lt;a href="https://avinash-sharma.com"&gt;Nginx&lt;/a&gt; The Nginx is a reverse proxy that enables the user to host a static and dynamic website &lt;/p&gt;

</description>
      <category>nginx</category>
      <category>node</category>
      <category>docker</category>
    </item>
    <item>
      <title>Nginx</title>
      <dc:creator>Avinash Sharma</dc:creator>
      <pubDate>Mon, 17 May 2021 08:23:45 +0000</pubDate>
      <link>https://dev.to/avinashsharma/nginx-8e1</link>
      <guid>https://dev.to/avinashsharma/nginx-8e1</guid>
      <description>&lt;p&gt;Nginx, stylized as NGINX, Nginx, or NginX, is a web server that can also be used as a reverse proxy, load balancer, mail proxy, and HTTP cache. The software was created by Igor Sysoev and publicly released in 2004. Nginx is free and open-source software, released under the terms of the 2-clause BSD license.&lt;/p&gt;

&lt;p&gt;It is also called reverse proxy..&lt;br&gt;
&lt;a href="http://avinash-sharma.com"&gt;Nginx&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
