In [163]:
# <ignore> start meta code for Jupyter notebook blog
from importlib import reload
from pprint import pprint
In [164]:
import nginx_auth_basic_blocker_meta as content
for m in (content, ):
reload(m)
# </ignore> end meta code for Jupyter notebook blog
With a suggestion from @savant aka José Diaz-Gonzalez at https://github.com/gliderlabs
In [165]:
content.display(content.wat())
In [166]:
url = 'http://docs.zip.thruhere.net/index.html'
response = !curl -s $url
_, _, _, response, *_ = response
content.display(content.HTML(response))
In [167]:
content.display(content.tweet())
In [168]:
content.print_outputs()
worker_processes 1;
error_log stderr;
pid nginx.pid;
daemon off;
events {
worker_connections 768;
}
# custom nginx config
http {
types_hash_max_size 2048;
include mime.types;
server {
listen <%= ENV["PORT"] %>;
server_name _;
<% if ENV["ROOT"] %>
root /app/www/<%= ENV["ROOT"] %>;
<% else %>
root /app/www;
<% end %>
location / {
auth_basic "closed site";
auth_basic_user_file /app/nginx/passwords;
# I have tried this, too.Some posts said the path is relative to nginx.con
# auth_basic_user_file passwords;
}
index index.html;
}
}
In [169]:
print(content.nginx_version)
--without-http_auth_basic_module \ to --with-http_auth_basic_module \