<?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>Control WebPanel Wiki &#187; Nginx</title>
	<atom:link href="http://wiki.centos-webpanel.com/category/nginx/feed" rel="self" type="application/rss+xml" />
	<link>http://wiki.centos-webpanel.com</link>
	<description>CentOS WebPanel Wiki</description>
	<lastBuildDate>Wed, 12 Feb 2025 20:38:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>WebServer Errors</title>
		<link>http://wiki.centos-webpanel.com/webserver-errors</link>
		<comments>http://wiki.centos-webpanel.com/webserver-errors#comments</comments>
		<pubDate>Tue, 25 Jan 2022 20:50:41 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[WebServer Errors]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=1702</guid>
		<description><![CDATA[The page isn’t redirecting properly - you probably have HTTPS redirect forced in .htaccess if you are using nginx then do a redirect via nginx https template 403 Forbidden - Mod Security (most common): click here for instructions - Incorrect include file location - Other apache rules or permissions For more details please check apache [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>The page isn’t redirecting properly</strong><br />
- you probably have HTTPS redirect forced in .htaccess if you are using nginx then do a redirect via nginx https template</p>
<p><strong>403 Forbidden</strong><br />
- Mod Security (most common): <a href="/mod_security-for-cwp" title="Mod Security info" target="_blank">click here for instructions</a><br />
- Incorrect include file location<br />
- Other apache rules or permissions<br />
For more details please check <a href="/service-log-paths" title="Apache Logs" target="_blank">apache logs</a>.</p>
<p><strong>500 Internal Server Error</strong><br />
Issue related to the server configuration, examples, and most common issues:<br />
- Domain has custom PHP version configured using .htaccess and that PHP version isn't installed<br />
- Domain has defined <strong>Options</strong> in .htaccess file, you need to remove line starting with Options<br />
- PHP/PHP-FPM version is not working well with the site code, try another version.<br />
- Error: "<em>End of script output before headers</em>" this can be related to file permissions, try using fix account permissions</p>
<p><strong>502 Bad Gateway</strong><br />
- PHP-FPM is down, try to restart PHP-FPM service<br />
- It can be also related to the small number of php-fpm processes, this can be changed from WebServers_conf by using "PHP-FPM default template" default process limit is 4.<br />
if some have issue increase to 20 or more depending on the requirements<br />
- It can be also related to apache having all processes used if you use nginx, in this case, if the server is not overloaded apache number of the process will need to be increased.</p>
<p><strong>503 Service Unavailable</strong><br />
- This is probably related to incorrect port redirection or php-fpm socket if not working<br />
- php-fpm is down<br />
- php-fpm specific version not installed (example missing php-fpm56 and domain is set to use it)<br />
Error_Log:  FCGI: attempt to connect to Unix domain socket /opt/alt/php-fpm56/usr/var/sockets/wwwener.sock (*) failed</p>
<p>Rebuild webservers and tail log: /var/log/cwp/webservers.log<br />
2018-12-20 01:12:57 <USERNAME> PHP-FPM php-fpm72: ERROR failed at quota or security limits<br />
TEST</p>
<pre>
# su USERNAME -c "touch /home/USERNAME/.quota-check" -s /bin/bash
su: cannot create child process: Resource temporarily unavailable
su: cannot open session: System error</pre>
<p>then this is probably related to users security limits you need to increase it and don't use 0 as this is the lowest limit.</p>
<p>if we have this output</p>
<pre>touch: cannot touch '/home/USERNAME/.quota-check': Permission denied</pre>
<p>then this means users home folder has incorrect permissions /home/USERNAME/</p>
<p>it can be also related to session restrictions in the pam file<br />
/etc/pam.d/su [know platforms having this issue: lxckvm]<br />
change "session include system-auth" to "session optional system-auth"</p>
<p><strong>503 Backend fetch failed</strong><br />
- This is probably related to incorrect backend configuration for varnish</p>
<p>https://stackoverflow.com/questions/34548690/how-to-increase-timeout-between-varnish-4-and-nginx</p>
<p><strong>504 GATEWAY TIMEOUT</strong><br />
- probably related to apache or php-fpm not responding, try restarting apache or php-fpm version you are using</p>
<p>For Apache issue: If the issue repeats then try to increase apache limits<br />
For PHP-FPM: If the issue repeats then try to increase the process limit as described above<br />
...more info to be added here</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.centos-webpanel.com/webserver-errors/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx Proxy: ERR_TOO_MANY_REDIRECTS</title>
		<link>http://wiki.centos-webpanel.com/nginx-proxy-err_too_many_redirects</link>
		<comments>http://wiki.centos-webpanel.com/nginx-proxy-err_too_many_redirects#comments</comments>
		<pubDate>Tue, 26 Jan 2021 08:28:27 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[ERR_TOO_MANY_REDIRECTS]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=1543</guid>
		<description><![CDATA[If you're getting ERR_TOO_MANY_REDIRECTS then something is not correctly set on your site i.e. it usually happens when the redirect is not set correctly or some plugin/module is the culprit such as SEO/pretty URL is active by some plugin/module which is creating an issue with redirects or the issue is coming from some URL redirect [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>If you're getting <strong>ERR_TOO_MANY_REDIRECTS</strong> then something is not correctly set on your site i.e. it usually happens when the redirect is not set correctly or some plugin/module is the culprit such as SEO/pretty URL is active by some plugin/module which is creating an issue with redirects or the issue is coming from some URL redirect plugin/module.</p>
<p><strong>To solve the issue try disabling any redirect plugin/module you've installed for your website and check if your website is loading fine or not.</strong></p>
<p>If it still doesn't solved alternatively you can also try to add this <strong>.</strong><strong>htaccess rule by removing/replacing current http-https redirect rule from .htaccess</strong> :</p>
<pre>SetEnvIf X-Forwarded-Proto "https" HTTPS=on
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://wiki.centos-webpanel.com/nginx-proxy-err_too_many_redirects/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling Brotli Compression on Nginx</title>
		<link>http://wiki.centos-webpanel.com/enabling-brotli-compression-on-nginx</link>
		<comments>http://wiki.centos-webpanel.com/enabling-brotli-compression-on-nginx#comments</comments>
		<pubDate>Wed, 15 May 2019 23:21:52 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Brotli for Nginx]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=1152</guid>
		<description><![CDATA[Brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods. It is similar in speed with deflate but offers more dense compression. Step 1 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods. It is similar in speed with deflate but offers more dense compression.</p>
<h2>Step 1 :</h2>
<p>Check <strong>Nginx</strong> web server/Proxy is already installed on your server</p>
<h2>Step 2 :</h2>
<p><strong>Download and install Nginx Static Brotli module :</strong></p>
<pre>cd /etc/nginx/modules
wget http://dl1.centos-webpanel.com/files/nginx/modules/nginx-brotli-modules.zip
unzip nginx-brotli-modules.zip
rm -rf nginx-brotli-modules.zip 
</pre>
<h2>Step 3 :</h2>
<p><strong>Now add nginx module configuration on "nginx.conf" :</strong></p>
<pre>nano /etc/nginx/nginx.conf
</pre>
<p><strong>Now add this lines on top of the nginx.conf :</strong></p>
<pre>load_module "modules/ngx_http_brotli_filter_module.so";
load_module "modules/ngx_http_brotli_static_module.so";
</pre>
<p><strong>Now add brotli compression configuration in nginx.conf file in <code>http {</code>section and before http closing <code>}</code>:</strong></p>
<pre>   #brotli
    brotli              on;
    brotli_comp_level   6;
    brotli_static       on;
    brotli_types        text/xml image/svg+xml application/x-font-ttf image/vnd.microsoft.icon application/x-font-opentype application/json font/eot application/vnd.ms-fontobject application/javascript font/otf application/xml application/xhtml+xml text/javascript  application/x-javascript text/plain application/x-font-truetype application/xml+rss image/x-icon font/opentype text/css image/x-win-bitmap;
</pre>
<p><strong>Save the file and restart nginx :</strong></p>
<pre>service nginx restart
or
systemctl restart nginx
</pre>
<p>Go to one of the site to check :<br />
<a href="https://www.giftofspeed.com/gzip-test/" target="_blank" rel="noopener">https://www.giftofspeed.com/gzip-test/</a><br />
<a href="https://www.websiteplanet.com/webtools/gzip-compression/" target="_blank">https://www.websiteplanet.com/webtools/gzip-compression/</a></p>
<p>For advanced user you can check content-encoding via http header :</p>
<pre>HTTP/2.0 200 OK
server: nginx
content-type: text/html; charset=UTF-8
vary: Accept-Encoding, Cookie
<strong><span style="color: #993300;">content-encoding: br</span>  </strong> 
</pre>
]]></content:encoded>
			<wfw:commentRss>http://wiki.centos-webpanel.com/enabling-brotli-compression-on-nginx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
