Updated Restrict upload using NGINX (markdown)

ViRb3 2019-08-18 00:01:59 +01:00
parent b2eeb811f7
commit 5c904dd8e5

@ -2,7 +2,7 @@
This is a neat and effective way to restrict paste uploading using NGINX without breaking anything and without modifying PrivateBin.
## Approach
An artificial authentication page is created using NGINX, which, if provided with the correct credentials, will set a cookie with a secret key. All POST requests to the server are restricted using NGINX and only allowed if this secret key is provided. This allows viewing pastes by anyone but not uploading.
An authentication page is created using NGINX, which, if provided with the correct credentials, will set a cookie with a secret key. All POST requests to the server are restricted using NGINX and only allowed if this secret key is provided. This allows viewing pastes by anyone but not uploading.
## Setup
1. Create your credentials file at: `/etc/nginx/.htpasswd`. You can use the [htpasswd](https://linux.die.net/man/1/htpasswd) tool, tutorial [here](https://www.cyberciti.biz/faq/create-update-user-authentication-files/)