• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

GridPane

  • How it Works
    • Creating Servers
    • Creating Websites
  • Use Cases
  • Pricing
  • Knowledge Base
  • More
    • FAQ
    • Apollo
    • Comparisons
    • Updates
  • Login
  • Free Trial
GridPane >Knowledge Base > Client Portal and GridPane

Client Portal and GridPane

Steve B
Updated on 25th August 2020

2 min read
Third-Party Software NoticeOur support team cannot provide support for third-party software and services. However, if you spot an issue with this article please let us know and we will endeavor to bring it up-to-date ASAP.

If you’re using the Client Portal plugin, you’ll see a message in your dashboard that says:

Because your server is running on Nginx, we cannot use the .htaccess file to protect your private files.
Please add the following rules to your Nginx config to disable direct file access:

location ~ ^/wp-content/uploads/leco-cp/(.*)$ { rewrite / permanent; }

You can usually ask your hosting service to help you with it. If you’re pretty sure the rules have been added, you can dismiss this message.

In our testing, the above code didn’t actually work as intended. It will return a 403 for the filepath above, but any private files inside /leco-cp/ will still be accessible when not logged in. We’ve modified it to only allow access to private files when logged into the website, and we’ve also reached out to the plugin author with our findings.

UPDATE: The above code is now their most recent updated recommendation. We had a brief correspondence with their team awhile back but haven’t tested this yet. For now, we still recommend you use our code below.

Below will walk you through how to add this to your server.

Step 1. SSH into your server:

Please see the following articles to get started:

Generate your SSH Key:

Generate SSH Key on Mac

Generate SSH Key on Windows with Putty

Generate SSH Key on Windows with Windows Subsystem for Linux

Generate SSH Key on Windows with Windows CMD/PowerShell

Add your SSH Key to GridPane:

Add default SSH Keys

Add/Remove an SSH Key to/from an Active GridPane Server

Connect to your server:

Connect to a GridPane server by SSH as Root user.

Step 2. Create a config for Client Portal

We’ll be creating a file called “clientportal-main-context.conf”. Run the following command switching out “site.url” for your website’s domain:

nano /var/www/site.url/nginx/clientportal-main-context.conf

Paste the following [modified] code into the file:

location ~* ^/wp-content/uploads/leco-cp/.*$ {
rewrite / permanent; allow 127.0.0.1; deny all; return 403; }

The above code ensures that when logged in, private files can be downloaded.
When not logged in, it will return a 403 forbidden error.

Ctrl+O and then press enter to save the file. Then Ctrl+X to exit nano.

We now need to test our nginx syntax with:

nginx -t

If there are no errors present, reload nginx with the following command:

gp ngx reload

Your Client Portal setup is now complete!

Primary Sidebar

Search the Knowledge Base

  • Provisioning Servers
  • Managing Servers
  • Managing Websites
  • SSL Certificates
  • Server Caching
  • Migrating to GridPane
  • Plugins / Services
  • Security
  • Performance
  • SMTP / Email
  • FAQ
  • Policies

Footer

Quick Links
  • Documentation
  • Status
  • Roadmap
  • Comparisons
  • Updates
  • Facebook Group
Connect With Us
  • (619) 4-SERVER
  • info@gridpane.com
Facebook-f
Twitter
Youtube

GridPane is the world’s first hosting control panel purpose-built for Serious WordPress Practitioners

© Copyright 2017-2021 – GridPane – Run WordPress the Right Way

Terms of Service – Privacy Policy – GDPR
Built with ❤ by S Bell
  • How it Works
    • Creating Servers
    • Creating Websites
  • Use Cases
  • Pricing
  • Knowledge Base
  • More
    • FAQ
    • Apollo
    • Comparisons
    • Updates
  • Login
  • Free Trial