Info Security Memo
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org

Build Confidence

Focusing on Information Security 

Info Security Notes

NPM (Nginx Proxy Manager) - Configure Basic HTTP Authentication and Use Universal SSL Certificate from Cloudflare

3/10/2023

0 Comments

 
NPM (Nginx Proxy Manager) - Configure Basic HTTP Authentication and Use Universal SSL Certificate from Cloudflare

This post is to show you some useful features from NPM. You can restrict access to your website or some parts of it by implementing a username/password authentication. One of NPM (Nginx Proxy Manager) features is 

  • Access Lists and basic HTTP Authentication for your hosts
You also can add a wilecard certificate from Cloudflare into NPM. In this way, you don't have to apply each certificate for your each subdomain. 


Steps to configure basic http authentication


1. Create Access List


2. Creaet a nwe Proxy host and assign access-list to it





3. Apply a new SSL certificate for your website "notepad.51sec.org"


4. Assign this new applied certificate to our Proxy Host



5. Testing with https://notepad.51sec.org/51sec


If you entered the wrong usernmae/password, you will get an 401 authentication failed message. 





Use Universal SSL Certificate from Cloudflare

In this lab, I am gonna using Cloudflare as an example to show you the steps how to get wildcard SSL certificate through NPM

1. Create a new token from Cloudflare

2. Use a template for Edit Zone DNS

Use a specific zone 



From NPM, create a new Lets Encrypt Certificate using this new generated Cloudflare API token:


Troubleshooting

Issue #1: When you uploading your certificate and private key into NPM, you might got a invlaid key error.

Solution:
Open your private key and change "BEGIN PRIVATE KEY" and "END PRIVATE KEY" to "BEGIN RSA PRIVATE KEY" and "END RSA PRIVATE KEY". Apparently with the latest version of NPM it needs the encryption type included in the key file header and footer to pass inspection for cloudflare provided certs.

Issue #2: Got internal error when tried to add *.mydomain.com and mydomain.com into same certificate. 

Solution: 
Create separate certs for both. 
If you did add both records into same certificate, your NPM will say "internal error" and you'll have to delete your nginx.conf files to get your docker container to restart.

Videos

 








References

  • HOWTO: Add a wildcard certificate in Nginx Proxy Manager using Cloudflare.
  • HomeLab 4: Install and configure Nginx Proxy Manager with SSL Wildcard Certs




via Blogger http://blog.51sec.org/2023/03/npm-nginx-proxy-manager-configure-basic.html
March 10, 2023 at 06:57PM Security
0 Comments



Leave a Reply.

    Categories

    All
    Architecture
    Blog
    Checkpoint
    Cisco
    Cloud
    CyberArk
    F5
    Fortigate
    Guardium
    Juniper
    Linux
    Network
    Others
    Palo Alto
    Qualys
    Raspberry Pi
    Security
    SIEM
    Software
    Vmware
    VPN
    Wireless

    Archives

    March 2024
    February 2024
    January 2024
    December 2023
    November 2023
    October 2023
    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    October 2019
    September 2019
    June 2019
    July 2018
    May 2018
    December 2017
    August 2017
    April 2017
    March 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015

    Print Page:

    RSS Feed

    Email Subscribe
Powered by Create your own unique website with customizable templates.
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org