Category: Webservers

How to Add a Custom HTTP Header to All Sites on a Plesk Server

Adding custom headers is a useful way to identify, trace, or control web traffic across a hosted environment. This guide walks through the process of adding the HTTP header X-Hosted-By: ExampleHost to all websites running on a Plesk server, across both nginx and Apache layers. Why Add a Custom Header? Custom HTTP headers can: Identify the infrastructure powering your site (e.g., for branding or tracing) Assist in diagnostics or security logging Be used for custom caching or CDN logic Step-by-Step: Add Header in nginx Step 1: Copy the nginx Template First, copy the default Plesk template into a custom directory:

Step 2: Edit the Template Open the copied file:

Locate the block that outputs header directives, such as:

Insert your custom header right after:

Step 3: Rebuild nginx Configurations

Step 4: Restart nginx

Step-by-Step: Add Header in Apache Step 1: Copy the Apache Template

Read More »

Protecting Website Search Function from Excessive Bot Traffic

Search functionality is a critical part of any website, helping users quickly find the information they need. However, excessive bot traffic—especially from search engine crawlers—can put a strain on your server resources, slow down performance, and even lead to increased hosting costs. One common issue is search engines aggressively crawling internal search pages, which are not meant for indexing. In this blog post, we’ll explore how to prevent unwanted bot traffic, particularly from Bingbot, using .htaccess rules to return a 404 error for specific URLs. Why Restrict Bots from Crawling Search Pages? Search engine bots, like Googlebot and Bingbot, continuously crawl websites to index their content. While this is generally beneficial for SEO, unrestricted crawling of search results pages can: Waste server resources: Bots continuously hitting dynamic search pages increase load on your database and web server. Index unnecessary pages: Internal search results don’t provide valuable standalone content and can

Read More »

Get Top 10 User Agents

Extract a list of the top user agents from an Apache format log file and sort in descending order by number of occurrences:

Results similar to this:

   

Read More »

Plesk / Nginx Open Files Limit

Was trying to increase open files limit for nginx on a Plesk server following instructions here: MariaDB on CentOS 7 – “Error in accept: Too many open files” But the limit was not changing. After digging around I found that Plesk was overriding with a config file here: /usr/lib/systemd/system/nginx.service.d/limit_nofile.conf As described here: https://support.plesk.com/hc/en-us/articles/213938485-nginx-fails-to-start-reload-on-a-Plesk-server-Too-many-open-files the easy way to fix open file limit on Plesk is to use: /usr/local/psa/admin/sbin/websrv_ulimits –set 100000 –no-restart

Read More »

Fixing “Size of a request header field exceeds server limit.” error

This error from Apache is typically caused by a very large cookie. In Apache the “LimitRequestFieldSize” directive sets this limit. The default is 8190 bytes. To change the file create a file at: /etc/httpd/conf.d/custom.conf or /etc/apache2/conf.d/custom.conf containing the desired change: LimitRequestFieldSize 16384 Reload Apache after adding the file with: /sbin/service apache2 restart or /sbin/service httpd restart

Read More »

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.