Skip to content

Instantly share code, notes, and snippets.

@andrehjr
Created January 4, 2011 09:41
Show Gist options
  • Save andrehjr/764593 to your computer and use it in GitHub Desktop.
Save andrehjr/764593 to your computer and use it in GitHub Desktop.
nginx.conf with basic_auth
$ sudo htpasswd -c -d /opt/nginx/conf/htpasswd andrehjr
worker_processes 1;
error_log logs/error.log;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
passenger_root /Users/andrehjr/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2;
passenger_ruby /Users/andrehjr/.rvm/wrappers/ruby-1.9.2-p136/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
auth_basic "Restricted";
auth_basic_user_file htpasswd;
passenger_enabled on;
listen 443;
server_name localhost;
root /Users/andrehjr/dev/work/h2/public;
index 404.html;
ssl on;
ssl_certificate /opt/nginx/conf/ssl/app.crt;
ssl_certificate_key /opt/nginx/conf/ssl/app.key;
keepalive_timeout 60;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment