NGINX
Increase client body limit
Add client_max_body_size directive to /etc/sites-available/site.conf:
server {
location LOCATION {
client_max_body_size 100M;
}
}
or (globally for whole server)
server {
client_max_body_size 100M;
}
HTTP → HTTPS redirect
server {
listen 80;
server_name NAME;
rewrite ^(.*) https://$host$1 permanent;
}
HTTP proxy with basic authentication
server {
listen 80 default_server;
location / {
auth_basic "Restricted";
auth_basic_user_file .htpasswd;
proxy_pass http://${FORWARD_HOST}:${FORWARD_PORT};
proxy_read_timeout 900;
}
}
Add users either with Apache's htpasswd (from apache2-utils):
# htpasswd -c /etc/nginx/.htpasswd <user>
or with Openssl:
# echo -n '<user>:' >> /etc/nginx/.htpasswd
# openssl passwd -apr1 >> /etc/nginx/.htpasswd