Created
October 26, 2015 12:18
-
-
Save ayonliu/28f0742b500e2669016a to your computer and use it in GitHub Desktop.
nginx config for scrapyd deployment to implement basic auth protection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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