<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to secure my Woocommerce site in Nginx server ?]]></title><description><![CDATA[<p dir="auto">Hi lankadevs,</p>
<p dir="auto">I'm new to nginx server i want to know how to secure my woocommerce site, i'm selling digital contents to my customers (photos, art works , etc), i want to protect digital content in the server side. please help me to achieve this task .</p>
<p dir="auto">Thanks guys.</p>
]]></description><link>https://lankadevelopers.lk/topic/141/how-to-secure-my-woocommerce-site-in-nginx-server</link><generator>RSS for Node</generator><lastBuildDate>Wed, 17 Jun 2026 03:28:51 GMT</lastBuildDate><atom:link href="https://lankadevelopers.lk/topic/141.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Feb 2019 17:28:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to secure my Woocommerce site in Nginx server ? on Sat, 23 Feb 2019 15:02:52 GMT]]></title><description><![CDATA[<p dir="auto">Thnaks yo very much <a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/27">@root</a> , this is awesome</p>
]]></description><link>https://lankadevelopers.lk/post/1088</link><guid isPermaLink="true">https://lankadevelopers.lk/post/1088</guid><dc:creator><![CDATA[lkdev]]></dc:creator><pubDate>Sat, 23 Feb 2019 15:02:52 GMT</pubDate></item><item><title><![CDATA[Reply to How to secure my Woocommerce site in Nginx server ? on Sat, 16 Feb 2019 18:45:01 GMT]]></title><description><![CDATA[<p dir="auto"><strong>Special Block for woocommerce digital content security</strong></p>
<pre><code class="language-nginx">location ~ /woocommerce_uploads {
   deny  all;
}
</code></pre>
]]></description><link>https://lankadevelopers.lk/post/967</link><guid isPermaLink="true">https://lankadevelopers.lk/post/967</guid><dc:creator><![CDATA[root]]></dc:creator><pubDate>Sat, 16 Feb 2019 18:45:01 GMT</pubDate></item><item><title><![CDATA[Reply to How to secure my Woocommerce site in Nginx server ? on Sat, 16 Feb 2019 18:38:45 GMT]]></title><description><![CDATA[<p dir="auto"><strong>Add following content to /etc/nginx/sites-available/example.com file</strong></p>
<pre><code class="language-nginx">#Deny access to wp-content folders for suspicious files
location ~* ^/(wp-content)/(.*?)\.(zip|gz|tar|bzip2|7z)\$ { deny all; }
location ~ ^/wp-content/uploads/sucuri { deny all; }
location ~ ^/wp-content/updraft { deny all; }
</code></pre>
<pre><code class="language-nginx"># Block nginx-help log from public viewing
location ~* /wp-content/uploads/nginx-helper/ { deny all; }
location ~ ^/(wp-includes/js/tinymce/wp-tinymce.php) {
  include /usr/local/nginx/conf/php.conf;
}
</code></pre>
<pre><code class="language-nginx"># Deny access to any files with a .php extension in the uploads directory
# Works in sub-directory installs and also in multisite network
location ~* /(?:uploads|files)/.*\.php\$ { deny all; }
</code></pre>
<pre><code class="language-nginx"># Deny access to uploads that aren’t images, videos, music, etc.
location ~* ^/wp-content/uploads/.*.(html|htm|shtml|php|js|swf|css)$ {
    deny all;
}
</code></pre>
<pre><code class="language-nginx"># Block PHP files in content directory.
location ~* /wp-content/.*\.php\$ {
  deny all;
}
</code></pre>
<pre><code class="language-nginx"># Block PHP files in includes directory.
location ~* /wp-includes/.*\.php\$ {
  deny all;
}
</code></pre>
<pre><code class="language-nginx"># Block PHP files in uploads, content, and includes directory.
location ~* /(?:uploads|files|wp-content|wp-includes)/.*\.php\$ {
  deny all;
}
</code></pre>
<pre><code class="language-nginx"># Make sure files with the following extensions do not get loaded by nginx because nginx would display the source code, and these files can contain PASSWORDS!
location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)\$|^(\..*|Entries.*|Repository|Root|Tag|Template)\$|\.php_
{
return 444;
}
</code></pre>
<pre><code class="language-nginx">#nocgi
location ~* \.(pl|cgi|py|sh|lua)\$ {
return 444;
}
</code></pre>
<pre><code class="language-nginx">#disallow
location ~* (w00tw00t) {
return 444;
}
location ~* /(\.|wp-config\.php|wp-config\.txt|changelog\.txt|readme\.txt|readme\.html|license\.txt) { deny all; }
</code></pre>
<p dir="auto"><strong>Add Following Headers to /etc/nginx/sites-available/example.com file</strong></p>
<pre><code class="language-nginx">add_header X-Frame-Options SAMEORIGIN;
</code></pre>
<pre><code class="language-nginx">add_header X-Content-Type-Options nosniff;
</code></pre>
<pre><code class="language-nginx">add_header X-XSS-Protection "1; mode=block";
</code></pre>
<pre><code class="language-nginx">add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://ssl.google-analytics.com https://s-static.ak.facebook.com https://assets.zendesk.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://assets.zendesk.com; font-src 'self' https://themes.googleusercontent.com; frame-src https://assets.zendesk.com https://www.facebook.com https://s-static.ak.facebook.com https://tautt.zendesk.com; object-src 'none'";
</code></pre>
<p dir="auto"><strong>Source</strong></p>
<hr />
<ol>
<li><a href="https://gist.github.com/ethanpil/1bfd01a817a8198369efec5c4cde6628" target="_blank" rel="noopener noreferrer nofollow ugc">https://gist.github.com/ethanpil/1bfd01a817a8198369efec5c4cde6628</a></li>
<li><a href="https://gist.github.com/plentz/6737338" target="_blank" rel="noopener noreferrer nofollow ugc">https://gist.github.com/plentz/6737338</a></li>
</ol>
]]></description><link>https://lankadevelopers.lk/post/966</link><guid isPermaLink="true">https://lankadevelopers.lk/post/966</guid><dc:creator><![CDATA[root]]></dc:creator><pubDate>Sat, 16 Feb 2019 18:38:45 GMT</pubDate></item></channel></rss>