Skip to content

Instantly share code, notes, and snippets.

@hzopak
Last active May 27, 2018 09:43
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hzopak/9573928 to your computer and use it in GitHub Desktop.
Save hzopak/9573928 to your computer and use it in GitHub Desktop.
nginx config for scrapyd deployment to implement basic auth protection
# Scrapyd local proxy for basic authentication.
# Don't forget iptables rule.
# iptables -A INPUT -p tcp --destination-port 6800 -s ! 127.0.0.1 -j DROP
server {
listen 6801;
location ~ /\.ht {
deny all;
}
location / {
proxy_pass http://127.0.0.1:6800/;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/conf.d/.htpasswd;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment