Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

Other uncategorised cookies are those that are being analysed and have not been classified into a category as yet.

Skip to content

Does Patchstack work with nginx?

If your server runs nginx, then the .htaccess functionality won’t work.

Apache has a feature that allows you to use a .htaccess file to easily implement or override rewrite rules on your site, but nginx does not have such a feature. In order for the rewrite rules to work, you must implement the nginx rules manually.

If you’re not sure how to do this, you should ask your host for further assistance since it varies by the host how the nginx configuration works and is implemented. Some hosts provide you with access to an nginx.conf file in the root of your site, but this is not a universal standard so we do not attempt to write to this file.

The official rewrite rules for nginx can be found below. This needs to be added to the server directive in the nginx configuration file of your site.

# Patchstack nginx protection rules.
# Disable directory listing and server signature
autoindex off;
server_tokens off;
# Block access to certain files.
location ~* \.(htaccess|htpasswd|errordocs|logs|log)$ {
return 403;
}
rewrite ^/readme\.html$ /index.php?webarx_fpage=101 break;
rewrite ^/license\.txt$ /index.php?webarx_fpage=102 break;
rewrite ^/wp-config\.php$ /index.php?webarx_fpage=103 break;
rewrite ^/wp-admin/includes/ /index.php?webarx_fpage=201 break;
rewrite ^/wp-includes/[^/]+\.php$ /index.php?webarx_fpage=202 break;
rewrite ^/wp-content/uploads/(.*)\.php$ /index.php?webarx_fpage=202 break;
rewrite ^/wp-includes/js/tinymce/langs/.+\.php /index.php?webarx_fpage=203 break;
rewrite ^/wp-includes/theme-compat/ /index.php?webarx_fpage=204 break;
rewrite ^/debug\.log$ /index.php?webarx_fpage=502 break;
if ($remote_addr != "18.221.197.243"){
rewrite ^/(.*)/plugins/(.*)readme\.(txt|html)$ /index.php?webarx_fpage=19 break;
}
# Prevent proxy comments.
if ($http_cookie !~* "^.*wordpress_logged_in.*$"){
set $blockcomment A;
}
if ($request_method = POST){
set $blockcomment "${blockcomment}B";
}
if ($http_via){
set $blockcomment "${blockcomment}C";
}
if ($http_forwarded){
set $blockcomment "${blockcomment}C";
}
if ($http_useragent_via){
set $blockcomment "${blockcomment}C";
}
if ($http_x_forwarded_for){
set $blockcomment "${blockcomment}C";
}
if ($http_x_forwarded_host){
set $blockcomment "${blockcomment}C";
}
if ($http_proxy_connection){
set $blockcomment "${blockcomment}C";
}
if ($http_xproxy_connection){
set $blockcomment "${blockcomment}C";
}
if ($http_http_pc_remote_addr){
set $blockcomment "${blockcomment}C";
}
if ($http_http_client_ip){
set $blockcomment "${blockcomment}C";
}
if ($blockcomment ~ "ABC"){
rewrite ^/wp-comments-post\.php$ /index.php?webarx_fpage=7 break;
}