Skip to content

Instantly share code, notes, and snippets.

View falsycat's full-sized avatar
☠️
moved to Gitea

falsycat falsycat

☠️
moved to Gitea
View GitHub Profile
@surjikal
surjikal / conditional-basic-auth.conf
Created July 13, 2013 02:34
Nginx - Only apply basic auth if htaccess file exists
server {
listen 80;
server_name ~^(?<instance>.+?)\.foo.example.com$;
set $instance_root /instances/$instance.foo.example.com;
set $htaccess_user_file /htaccess/$instance.foo.example.com.htaccess;
root $instance_root;
# Abusing unused error codes to perform an internal redirect