<?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>nginx Archives - Installing.in</title>
	<atom:link href="https://www.installing.in/tag/nginx/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.installing.in/tag/nginx/</link>
	<description></description>
	<lastBuildDate>Sat, 13 Aug 2022 20:47:15 +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>
<site xmlns="com-wordpress:feed-additions:1">110734269</site>	<item>
		<title>[Solved] Ubuntu refusing connection on port 80</title>
		<link>https://www.installing.in/solved-ubuntu-refusing-connection-on-port-80/</link>
					<comments>https://www.installing.in/solved-ubuntu-refusing-connection-on-port-80/#respond</comments>
		
		<dc:creator><![CDATA[Rajeev]]></dc:creator>
		<pubDate>Sat, 13 Aug 2022 20:13:28 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[openvpn]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ufw]]></category>
		<guid isPermaLink="false">https://www.installing.in/?p=793</guid>

					<description><![CDATA[<p>I was getting this issue that I was not able to connect to port 80 on ubuntu server. Same virtual network settings were being used with a different instance but... </p>
<p>The post <a href="https://www.installing.in/solved-ubuntu-refusing-connection-on-port-80/">[Solved] Ubuntu refusing connection on port 80</a> appeared first on <a href="https://www.installing.in">Installing.in</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>I was getting this issue that I was not able to connect to port 80 on ubuntu server. Same virtual network settings were being used with a different instance but everything was working fine on it. I figured the problem is in the instance settings.</p>



<p>I searched through the web but nothing was working. So I decided to go through the server log. I know I should have done this first.</p>



<p>I found these lines in the <code>syslog</code> file:</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/www.installing.in/wp-content/uploads/2022/08/iptable_persistent_flush.png?ssl=1"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="760" height="161" src="https://i0.wp.com/www.installing.in/wp-content/uploads/2022/08/iptable_persistent_flush.png?resize=760%2C161&#038;ssl=1" alt="" class="wp-image-794"/></a></figure>



<p> The issue was in iptables and I needed to flush it</p>



<p>I ran the command highlighted in the the image above</p>



<pre class="wp-block-preformatted">/usr/sbin/netfilter-persistent flush </pre>



<p>It gave following output</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/www.installing.in/wp-content/uploads/2022/08/iptable-flush.png?ssl=1"><img data-recalc-dims="1" decoding="async" width="757" height="130" src="https://i0.wp.com/www.installing.in/wp-content/uploads/2022/08/iptable-flush.png?resize=757%2C130&#038;ssl=1" alt="" class="wp-image-795"/></a></figure>



<p>I tried to to connect to the port 80 and the default nginx page loaded in browser.</p>



<p>Problem solved.</p>



<p>But doing this messed up my OpenVPN server. OpenVPN client was connecting but internet was not accessible.</p>



<p>So I rebooted the system to see if it fixes the problem. </p>



<p>It did fixed OpenVPN. </p>



<p>But again port 80 was inaccessible.</p>



<p>I checked the status of <code>ufw</code> and it was disable. I had enabled it before I rebooted. Iptable rules were all reset. I googled why <code>ufw </code>was disabled and found<code> iptables-persistent </code>conflicts with <code>ufw</code>.</p>



<p>I disabled <code>iptables-persisten</code>t using this command</p>



<pre class="wp-block-preformatted">sudo systemctl disable netfilter-persistent</pre>



<p>I rebooted the system again and this time <code>ufw</code> stayed enabled and I was able to access the port 80 and also OpenVPN was working as intended.</p>



<p></p>
<p>The post <a href="https://www.installing.in/solved-ubuntu-refusing-connection-on-port-80/">[Solved] Ubuntu refusing connection on port 80</a> appeared first on <a href="https://www.installing.in">Installing.in</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.installing.in/solved-ubuntu-refusing-connection-on-port-80/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">793</post-id>	</item>
		<item>
		<title>How to install Openresty on Ubuntu 18.04</title>
		<link>https://www.installing.in/how-to-install-openresty-on-ubuntu-18-04/</link>
					<comments>https://www.installing.in/how-to-install-openresty-on-ubuntu-18-04/#comments</comments>
		
		<dc:creator><![CDATA[Rajeev]]></dc:creator>
		<pubDate>Fri, 08 Mar 2019 14:42:01 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[web server]]></category>
		<guid isPermaLink="false">https://www.installing.in/?p=488</guid>

					<description><![CDATA[<p>Openresty is a web app server built on popular Nginx web server with lots of advanced features built-in. It is almost a drop-in replacement for Nginx. Openresty has many built-in... </p>
<p>The post <a href="https://www.installing.in/how-to-install-openresty-on-ubuntu-18-04/">How to install Openresty on Ubuntu 18.04</a> appeared first on <a href="https://www.installing.in">Installing.in</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Openresty is a web app server built on popular Nginx web server with lots of advanced features built-in. It is almost a drop-in replacement for Nginx.</p>
<p>Openresty has many built-in Nginx modules that make it a powerful web app server. A most popular feature of Openresty is built-in Lua programming language support. You can directly use Lua scripts inside the Nginx conf files. You can write a high performance web application in Lua without having to install any other package other then Openresty.</p>
<p>For this guide, I will be using a fresh 1GB server from <a href="https://www.vultr.com/?ref=7841070-4F" target="_blank" rel="noopener noreferrer">Vultr</a> hosted in Germany.</p>
<p>There are 2 ways to install Openresty. Either you can use the prebuilt binaries or you can download the source and compile it yourself.</p>
<p>For this guide, I will be using the first method as it is easier and also it makes it easier to update Openresty later.</p>
<p><strong>Step 1: Import the GPG key:</strong></p>
<p>We need to import a GPG key as the package we will be downloading is encrypted and this key helps in verifying the package&#8217;s authenticity. Run following command to download and add the GPG key from the Openresty official server.</p>
<pre>wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -</pre>
<p><strong>Step 2: Add Openresty repository:</strong></p>
<p>Let us first add the apt-add-repository command</p>
<pre>sudo apt-get -y install software-properties-common</pre>
<p>Now run below command to add the repository. This command will detect the version of ubuntu you are using and add the appropriate repository.</p>
<pre>sudo add-apt-repository -y <span class="hljs-string">"deb http://openresty.org/package/ubuntu <span class="hljs-variable">$(lsb_release -sc)</span> main"</span></pre>
<p>Now you will have the official Openresty apt repository added to your system.</p>
<p><strong>Step 3: Install Openresty:</strong></p>
<p>First let&#8217;s update the apt index. Use this command to do so</p>
<pre>sudo apt-get update</pre>
<p>Now run this command to download and install the Openresty from its official repository</p>
<pre>sudo apt-get install openresty</pre>
<p>If everything goes well you will have Openresty successfully installed of your server.</p>
<p>Check it by visiting the IP address of your server. You will see a page like this:</p>
<p><img data-recalc-dims="1" decoding="async" class="alignnone size-full wp-image-493" src="https://i0.wp.com/www.installing.in/wp-content/uploads/2019/03/openresty-welcome-page.png?resize=744%2C324&#038;ssl=1" alt="openresty_welcome_page" width="744" height="324"></p>
<p><em><strong>Bonus tip:</strong></em></p>
<p>If you are trying to replace previously installed Nginx with Openresty rather the installing it on fresh server then disable and stop the Nginx before following this tutorial.</p>
<p>Disable Nginx with this command</p>
<pre>sudo systemctl <span class="hljs-built_in">disable</span> nginx</pre>
<p>and stop Nginx with this command</p>
<pre>sudo systemctl stop nginx</pre>
<p>If you face any problem while installing openresty please let me know in the comments section so we can solve it together.</p>
<p>The post <a href="https://www.installing.in/how-to-install-openresty-on-ubuntu-18-04/">How to install Openresty on Ubuntu 18.04</a> appeared first on <a href="https://www.installing.in">Installing.in</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.installing.in/how-to-install-openresty-on-ubuntu-18-04/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">488</post-id>	</item>
		<item>
		<title>How to install Letsencrypt with NobeBB and Nginx</title>
		<link>https://www.installing.in/how-to-install-letsencrypt-with-nobebb-and-nginx/</link>
					<comments>https://www.installing.in/how-to-install-letsencrypt-with-nobebb-and-nginx/#comments</comments>
		
		<dc:creator><![CDATA[Rajeev]]></dc:creator>
		<pubDate>Wed, 18 May 2016 16:41:47 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Webapp]]></category>
		<category><![CDATA[letsencrypt]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[nginx nodebb]]></category>
		<category><![CDATA[nodeBB]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://www.installing.in/?p=34</guid>

					<description><![CDATA[<p>In my last tutorial I wrote&#160;about how to install nodeBB on ubuntu 14.04 and use nginx as reverse proxy to serve nodeBB. In this tutorial we will install letsencrypt SSL... </p>
<p>The post <a href="https://www.installing.in/how-to-install-letsencrypt-with-nobebb-and-nginx/">How to install Letsencrypt with NobeBB and Nginx</a> appeared first on <a href="https://www.installing.in">Installing.in</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In my last tutorial I wrote&nbsp;about how to install nodeBB on ubuntu 14.04 and use nginx as reverse proxy to serve nodeBB. In this tutorial we will install letsencrypt SSL certificate to make sure our nodeBB forum is served over secure https connection.</p>
<p>In this series:</p>
<ul>
<li><a href="https://www.installing.in/how-to-install-nodebb-on-ubuntu-14-04/">How to Install NodeBB on Ubuntu 14.04&nbsp;</a>&nbsp;(Previous)</li>
<li><a href="https://www.installing.in/how-to-install-letsencrypt-with-nobebb-and-nginx/">How to install Letsencrypt with NobeBB and Nginx</a>&nbsp;(This tutorial)</li>
<li><a href="https://www.installing.in/how-to-set-up-letsencrypt-auto-renewal/">How to Set up Letsencrypt Auto Renewal</a>&nbsp;(Later)</li>
</ul>
<p><span style="line-height: 1.5;">Steps you need to follow:</span></p>
<ol>
<li>Install nodeBB forum</li>
<li>Install nginx server</li>
<li>Install letsencrypt client</li>
<li>Obtain&nbsp;letsencrypt SSL certificate</li>
<li>Configure nginx to to use the SSL certificate</li>
</ol>
<p><strong>For first and second steps see this tutorial &#8211;&gt;<a href="https://www.installing.in/how-to-install-nodebb-on-ubuntu-14-04/">How to Install NodeBB on Ubuntu 14.04</a>.</strong></p>
<h3>Install Letsencrypt client:</h3>
<p>Currently best way to install letsencrypt on ubuntu is to clone letsencrypt repository from github. So we will first install git and bc on our system.</p>
<pre>sudo apt-get update</pre>
<pre>sudo apt-get -y install git bc</pre>
<p>Now clone letsencrypt repository</p>
<pre>sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt

</pre>
<p>You can find copy of letsencrypt repository in the&nbsp;/opt/letsencrypt folder.</p>
<p>You have successfully installed letsencrypt client on your system.</p>
<h3>Obtain letsencrypt SSL certificate:</h3>
<p>We will be using Webroot plugin to obtain SSL certificate.</p>
<p>Webroot plugin works by placing a special file in the <code>/.well-known</code> directory within your document root, which letsencrypt will open for validation. You need to allow access to this <code>/.well-known</code> directory.</p>
<pre>sudo nano /etc/nginx/sites-available/default</pre>
<p>inside the nodebb server block we created in last tutorial add this location block:</p>
<pre> location ~ /.well-known {
          allow all;
 }</pre>
<p><a href="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/rv_%E2%80%94_root_nodebbtest___opt_letsencrypt_%E2%80%94_ssh_%E2%80%94_90%C3%9729.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" class="aligncenter size-full wp-image-41" src="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/rv_%E2%80%94_root_nodebbtest___opt_letsencrypt_%E2%80%94_ssh_%E2%80%94_90%C3%9729.png?resize=655%2C436&#038;ssl=1" alt="rv_—_root_nodebbtest___opt_letsencrypt_—_ssh_—_90×29" width="655" height="436"></a></p>
<p>press <code>ctrl+O</code> then <code>enter</code> to save</p>
<p>press <code>ctrl+x</code> to exit</p>
<p>Reload nginx to load the new configuration.</p>
<pre>sudo service nginx reload</pre>
<p>Now that we have done the initial setup it&#8217;s time to obtain the actual certificate.</p>
<p>Go to letsencrypt &nbsp;client directory by entering this command:</p>
<pre>cd /opt/letsencrypt</pre>
<p>Run this command to obtain certificate for your domain &nbsp;(replace <span style="color: #ff0000;">red text</span> with your domain):</p>
<pre>./letsencrypt-auto certonly -a webroot --webroot-path=<span class="highlight">/usr/share/nginx/html</span> -d <span class="highlight" style="color: #ff0000;">example.com</span> -d <span class="highlight" style="color: #ff0000;">www.example.com</span></pre>
<p>You will be prompted for some information. Exact prompts depends on whether you have used letsencrypt earlier on your system or not.</p>
<p>It will ask for your email address which will be used for notices and lost key recovery.</p>
<p><a href="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/rv_%E2%80%94_root_nodebbtest___opt_letsencrypt_%E2%80%94_ssh_%E2%80%94_95%C3%9725.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" class="aligncenter size-full wp-image-44" src="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/rv_%E2%80%94_root_nodebbtest___opt_letsencrypt_%E2%80%94_ssh_%E2%80%94_95%C3%9725.png?resize=690%2C380&#038;ssl=1" alt="rv_—_root_nodebbtest___opt_letsencrypt_—_ssh_—_95×25" width="690" height="380"></a></p>
<p>You will need to agree to Letsencrypt terms of service.</p>
<p><a href="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/rv_%E2%80%94_root_nodebbtest___opt_letsencrypt_%E2%80%94_ssh_%E2%80%94_95%C3%9725-2.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" class="aligncenter size-full wp-image-43" src="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/rv_%E2%80%94_root_nodebbtest___opt_letsencrypt_%E2%80%94_ssh_%E2%80%94_95%C3%9725-2.png?resize=690%2C380&#038;ssl=1" alt="rv_—_root_nodebbtest___opt_letsencrypt_—_ssh_—_95×25 2" width="690" height="380"></a></p>
<p>if everything goes successfully you will see something like this:</p>
<p><a href="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/rv_%E2%80%94_root_nodebbtest___opt_letsencrypt_%E2%80%94_ssh_%E2%80%94_93%C3%9711.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" class="aligncenter size-full wp-image-42" src="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/rv_%E2%80%94_root_nodebbtest___opt_letsencrypt_%E2%80%94_ssh_%E2%80%94_93%C3%9711.png?resize=676%2C184&#038;ssl=1" alt="rv_—_root_nodebbtest___opt_letsencrypt_—_ssh_—_93×11" width="676" height="184"></a></p>
<p>Note the path of your certificate. this is needed in next step.</p>
<h3>Configure nginx to to use the SSL certificate:</h3>
<p>Now we need to edit the nginx configuration so nginx uses the freshly generated SSL certificate to serve our nodeBB forum over https connection.</p>
<pre>sudo nano /etc/nginx/sites-available/default</pre>
<p>Delete the server block we created in last tutorial and replace it with the code block below.</p>
<p>Replace with your domain where&nbsp;marked red.</p>
<pre>server {
listen 80;
 server_name <span style="color: #ff0000;">example.com www.example.com</span>;
 return 301 https://$host$request_uri;
}
server {
 listen 443 ssl;
 server_name <span style="color: #ff0000;">example.com www.example.com</span>;
 ssl_certificate /etc/letsencrypt/live/<span style="color: #ff0000;">example.com</span>/fullchain.pem;
 ssl_certificate_key /etc/letsencrypt/live/<span style="color: #ff0000;">example.com</span>/privkey.pem;
 location / {
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header Host $http_host;
 proxy_set_header X-NginX-Proxy true;
 proxy_pass http://127.0.0.1:4567/;
 proxy_redirect off;
 # Socket.IO Support
 proxy_http_version 1.1;
 proxy_set_header Upgrade $http_upgrade;
 proxy_set_header Connection "upgrade";
 }
 location ~ /.well-known {
 allow all;
 }
}

</pre>
<p>It should look like this:</p>
<p><a href="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/rv_%E2%80%94_root_nodebbtest___opt_letsencrypt_%E2%80%94_ssh_%E2%80%94_96%C3%9731-2.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" class="aligncenter size-full wp-image-45" src="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/rv_%E2%80%94_root_nodebbtest___opt_letsencrypt_%E2%80%94_ssh_%E2%80%94_96%C3%9731-2.png?resize=697%2C464&#038;ssl=1" alt="rv_—_root_nodebbtest___opt_letsencrypt_—_ssh_—_96×31 2" width="697" height="464"></a></p>
<p>Now reload nginx to put changes into effect.</p>
<pre>sudo service nginx reload

</pre>
<p>Check your forum by visiting it using https</p>
<pre>https://www.example.com</pre>
<p>&nbsp;</p>
<p><a href="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/Home___NodeBB.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" class="aligncenter size-full wp-image-40" src="https://i0.wp.com/www.installing.in/wp-content/uploads/2016/05/Home___NodeBB.png?resize=760%2C471&#038;ssl=1" alt="Home___NodeBB" width="760" height="471"></a></p>
<p>Thats it. Hope it help</p>
<p>Next in series:</p>
<ul>
<li><a href="https://www.installing.in/how-to-set-up-letsencrypt-auto-renewal/">How to Set up Letsencrypt Auto Renewal</a></li>
</ul>
<p>The post <a href="https://www.installing.in/how-to-install-letsencrypt-with-nobebb-and-nginx/">How to install Letsencrypt with NobeBB and Nginx</a> appeared first on <a href="https://www.installing.in">Installing.in</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.installing.in/how-to-install-letsencrypt-with-nobebb-and-nginx/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">34</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Object Caching 22/85 objects using Redis
Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Minified using Disk
Database Caching using Redis (Request-wide modification query)

Served from: installing.in @ 2026-05-21 02:00:53 by W3 Total Cache
-->