<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nginx on The Gnu Pit</title><link>https://gnupit.net/nginx/</link><description>Recent content in Nginx on The Gnu Pit</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 12 Aug 2025 07:12:15 -0500</lastBuildDate><atom:link href="https://gnupit.net/nginx/index.xml" rel="self" type="application/rss+xml"/><item><title>Upgrading to Debian 13 Trixie</title><link>https://gnupit.net/posts/upgrading_to_debian13/</link><pubDate>Tue, 12 Aug 2025 07:12:15 -0500</pubDate><guid>https://gnupit.net/posts/upgrading_to_debian13/</guid><description>&lt;p&gt;Ah, the trials and tribulations of upgrading Debian 12 Bookworm to Debian 13 Trixie! I learned a valuable lesson this weekend with the update - always read the apt listchanges email. Always.&lt;/p&gt;
&lt;p&gt;The upgrade itself went smoothly with no errors during the packages upgrading/installing. I run three main services on my server - nginx, exim, and dovecot. On reboot, all three had issues with the upgraded packages.&lt;/p&gt;
&lt;h3 id="nginx"&gt;nginx&lt;/h3&gt;
&lt;p&gt;I received the following error in my nginx error.log:&lt;/p&gt;</description></item><item><title>Nginx, OCSP stapling, booting, systemd and Debian 9</title><link>https://gnupit.net/posts/systemd_nginx_fix/</link><pubDate>Sun, 10 Dec 2017 18:26:24 -0500</pubDate><guid>https://gnupit.net/posts/systemd_nginx_fix/</guid><description>&lt;p&gt;Noticed these lines in journalctl when nginx didn&amp;rsquo;t start after a reboot:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Dec 10 17:43:30 mail1 nginx[3485]: nginx: [warn] &amp;#34;ssl_stapling&amp;#34; ignored, host not found in OCSP responder &amp;#34;ocsp.int-x3.letsencrypt.org&amp;#34; in the certificate &amp;#34;/etc/letsencrypt/live/www.example.com/fullchain.pem&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Dec 10 17:43:30 mail1 nginx[3485]: nginx: [emerg] bind() to [&amp;lt;IPv6 address&amp;gt;]:80 failed (99: Cannot assign requested address)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Dec 10 17:43:30 mail1 nginx[3485]: nginx: configuration file /etc/nginx/nginx.conf test failed
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Dec 10 17:43:30 mail1 systemd[1]: nginx.service: Control process exited, code=exited status=1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Dec 10 17:43:30 mail1 systemd[1]: nginx.service: Unit entered failed state.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Dec 10 17:43:30 mail1 systemd[1]: nginx.service: Failed with result &amp;#39;exit-code&amp;#39;.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Dec 10 17:52:35 mail1 systemd[1]: nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Hmmm&amp;hellip;&lt;/p&gt;</description></item><item><title>Let's Encypt SSL Certificates with Exim, Dovecot &amp; NGINX</title><link>https://gnupit.net/posts/exim_dovecot_nginx_letsencrypt/</link><pubDate>Fri, 19 May 2017 14:32:24 -0500</pubDate><guid>https://gnupit.net/posts/exim_dovecot_nginx_letsencrypt/</guid><description>&lt;p&gt;I ran into two issues when setting up Let&amp;rsquo;s Encrypt SSL certificates on two of my servers - permission issues for Exim and the certbot cron job supplied by the package doesn&amp;rsquo;t handle the renew very well for nginx, exim or dovecot.&lt;/p&gt;
&lt;h3 id="resolving-exims-permission-problems"&gt;Resolving Exim&amp;rsquo;s Permission Problems&lt;/h3&gt;
&lt;p&gt;1. Create a new group. I named it sslcerts. Add the exim user to that group. If you&amp;rsquo;re not using Debian, adjust the user in the command below.&lt;/p&gt;</description></item><item><title>Boot issue with systemd and NGINX</title><link>https://gnupit.net/posts/nginx_boot_issue/</link><pubDate>Mon, 08 May 2017 21:11:24 -0500</pubDate><guid>https://gnupit.net/posts/nginx_boot_issue/</guid><description>&lt;p&gt;I ran into a problem with NGINX failing to start on boot/reboot on my Debian 8 (Jessie) server. After reviewing what seemed like a hundred sites to try to find a fix, I stumbled across one solution that worked, but was incredibly inelegant. This was to add:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;RestartSec=30s
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Restart=on-failure
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;to nginx.service in the [Service] section using the override.conf. It worked but didn&amp;rsquo;t fix the underlying problem.&lt;/p&gt;
&lt;p&gt;A quick look using &lt;code&gt;journalctl -u nginx&lt;/code&gt; showed that the service was failing because the IPv6 address hadn&amp;rsquo;t been assigned to the network adaptor yet. This caused nginx to fail because it couldn&amp;rsquo;t bind to the IPv6 port. Here are the log lines:&lt;/p&gt;</description></item><item><title>Script: Assemble NGINX Configuration Files</title><link>https://gnupit.net/posts/nginx_merge_script/</link><pubDate>Fri, 12 Sep 2014 19:19:24 -0500</pubDate><guid>https://gnupit.net/posts/nginx_merge_script/</guid><description>&lt;p&gt;&lt;a href="https://bitbucket.org/troubleshooter/merge-ngx-conf/src/master/"&gt;merge-ngx-conf.pl&lt;/a&gt; is a perl script used to assemble a set of nginx configuration files for one site. It has a number of options. See the bitbucket page or the help documentation in the script itself.&lt;/p&gt;
&lt;p&gt;In its simplest form, it&amp;rsquo;s called by issuing this command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;merge-ngx-conf.pl /path/sites-available/filename&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The output is an assembled nginx configuration file with all the includes inserted. Using &lt;code&gt;nginx.conf&lt;/code&gt; and &lt;code&gt;domain.conf&lt;/code&gt; (or just &lt;code&gt;domain.conf&lt;/code&gt; depending on the options selected), the script iterates through the include directives in the files and inserts the text from the referenced file. The script handles wildcard masks and follows include directives down multiple levels (i.e. nested levels). It will also follow referenced files in directories external to the nginx configuration directory.&lt;/p&gt;</description></item><item><title>nginx core module: worker_rlimit_nofile</title><link>https://gnupit.net/posts/worker_rlimit_nofile/</link><pubDate>Sat, 16 Jun 2012 00:54:24 -0500</pubDate><guid>https://gnupit.net/posts/worker_rlimit_nofile/</guid><description>&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Configuration file: nginx.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Block: main
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Value type: number
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Default: none - system determined (see notes section below)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;What it does: sets the value for the maximum file descriptors
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; that can be opened by a single worker process
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Example: worker_rlimit_nofile 1024;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;NOTES:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When any program opens a file, the operating system (OS) returns a file descriptor (FD) that corresponds to that file. The program will refer to that FD in order to process the file. The limit for the maximum FDs on the server is usually set by the OS. To determine what the FD limits are on your server use the commands &amp;lsquo;ulimit -Hn&amp;rsquo; and &amp;lsquo;ulimit -Sn&amp;rsquo; which will give you the per user hard and soft file limits. To determine the maximum number of FDs available, use the command &amp;lsquo;sysctl fs.file-max&amp;rsquo; or &amp;lsquo;cat /proc/sys/fs/file-max&amp;rsquo;.&lt;/p&gt;</description></item></channel></rss>