<?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 &#8211; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/nginx/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Fri, 06 Jan 2023 03:58:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://myshittycode.com/wp-content/uploads/2022/04/cropped-icon-32x32.png</url>
	<title>Nginx &#8211; My Shitty Code</title>
	<link>https://myshittycode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">205304208</site>	<item>
		<title>Nginx: Requesting and Configuring SSL Certificate</title>
		<link>https://myshittycode.com/2020/06/25/nginx-requesting-and-configuring-ssl-certificate/</link>
					<comments>https://myshittycode.com/2020/06/25/nginx-requesting-and-configuring-ssl-certificate/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Thu, 25 Jun 2020 20:34:34 +0000</pubDate>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Nginx]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=1173</guid>

					<description><![CDATA[<p>INTRO Step by step instructions for my future self to obtain the SSL certificate and to configure it in Nginx because my fragile little brain cannot retain them at the moment. INSTRUCTIONS Generate a private key and store it in a safe place. Generate a certificate signing request (CSR). Request a SSL certificate from Certificate [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2020/06/25/nginx-requesting-and-configuring-ssl-certificate/">Nginx: Requesting and Configuring SSL Certificate</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">INTRO</h2>



<p class="wp-block-paragraph">Step by step instructions for my future self to obtain the SSL certificate and to configure it in Nginx because my fragile little brain cannot retain them at the moment.</p>



<h2 class="wp-block-heading">INSTRUCTIONS</h2>



<p class="wp-block-paragraph">Generate a private key and store it in a safe place.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
openssl genrsa -out myshittycode_com.key 2048

</pre></div>


<p class="wp-block-paragraph">Generate a certificate signing request (CSR).</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
openssl req -new -sha256 \
  -key myshittycode_com.key \
  -out myshittycode_com.csr	\
  -subj &quot;/C=US/ST=ShittyState/L=ShittyCity/OU=ShittyUnit/O=ShittyCompany/CN=myshittycode.com&quot;

</pre></div>


<p class="wp-block-paragraph">Request a SSL certificate from Certificate Authority (ex: Sectigo) using the generated CSR.</p>



<p class="wp-block-paragraph">If approved, you will receive an email similar to the below.</p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="2008" height="1308" src="https://myshittycode.com/wp-content/uploads/2020/06/ssl-certificate-1.png?x45560" alt="ssl-certificate" class="wp-image-1175" srcset="https://myshittycode.com/wp-content/uploads/2020/06/ssl-certificate-1.png 2008w, https://myshittycode.com/wp-content/uploads/2020/06/ssl-certificate-1-300x195.png 300w, https://myshittycode.com/wp-content/uploads/2020/06/ssl-certificate-1-1024x667.png 1024w, https://myshittycode.com/wp-content/uploads/2020/06/ssl-certificate-1-768x500.png 768w, https://myshittycode.com/wp-content/uploads/2020/06/ssl-certificate-1-1536x1001.png 1536w" sizes="(max-width: 2008px) 100vw, 2008px" /></figure>



<p class="wp-block-paragraph">To configure the SSL certificate in Nginx, don&#8217;t use <b>Certificate (w/ chain), PEM encoded</b> because it contains the certificates in the following order:-</p>



<ul class="wp-block-list">
<li>Root CA certificate</li>



<li>Intermediate CA certificate</li>



<li>Certificate</li>
</ul>



<p class="wp-block-paragraph">Nginx wants them in this order:-</p>



<ul class="wp-block-list">
<li>Certificate</li>



<li>Root CA certificate</li>



<li>Intermediate CA certificate</li>
</ul>



<p class="wp-block-paragraph">To pull this off, download <b>Certificate only, PEM encoded</b> and <b>Root/Intermediate(s) only, PEM encoded</b>.</p>



<p class="wp-block-paragraph">Then combine them into one file in the proper order.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
cat myshittycode_com_cert.cer myshittycode_com_interm.cer &gt; myshittycode_com_bundle.crt

</pre></div>


<p class="wp-block-paragraph">In nginx.conf, add the bundle certificate, private key and server name.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; highlight: [4,5,6]; title: ; notranslate">
server {
  listen               443;
  ssl                  on;
  ssl_certificate      /etc/pki/tls/certs/myshittycode_com_bundle.crt;
  ssl_certificate_key  /etc/pki/tls/private/myshittycode_com.key;
  server_name          myshittycode.com;

  location / {
    ...
  }
}

</pre></div>


<p class="wp-block-paragraph">Restart Nginx service.</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2020/06/25/nginx-requesting-and-configuring-ssl-certificate/">Nginx: Requesting and Configuring SSL Certificate</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2020/06/25/nginx-requesting-and-configuring-ssl-certificate/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1173</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

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching 49/69 queries in 0.020 seconds using Disk

Served from: myshittycode.com @ 2026-07-21 10:54:44 by W3 Total Cache
-->