首页 > 窍门 > 科技数码

nginx中对指定的IP不使用密码对区域外IP使用密码

来源: 更新时间:2024-06-02 00:09:19
The Beginning

## example admin siteInF育儿早教网

server {InF育儿早教网

server_name $HOSTNAME.dashboard.example.com;InF育儿早教网

listen 80;InF育儿早教网

# http://serverfault.com/questions/242218/how-to-disable-http-basic-auth-in-nginx-for-a-specific-ip-rangeInF育儿早教网

satisfy any;InF育儿早教网

allow 210.22.143.202/32;InF育儿早教网

deny all;InF育儿早教网

auth_basic "example Restricted";InF育儿早教网

auth_basic_user_file htpasswd;InF育儿早教网

error_page 404 /404;InF育儿早教网

error_page 503 /503;InF育儿早教网

#charset koi8-r;InF育儿早教网

access_log logs/dashboard.access.log;InF育儿早教网

error_log logs/dashboard.error.log;InF育儿早教网

location / {InF育儿早教网

proxy_pass http://127.0.0.1:8001;InF育儿早教网

proxy_redirect default;InF育儿早教网

proxy_set_header X-Real-IP $remote_addr;InF育儿早教网

}InF育儿早教网

location /assets {InF育儿早教网

alias $DEPLOY_ROOT_DIR/DashboardServer/assets/;InF育儿早教网

}InF育儿早教网

}InF育儿早教网

THE END

TAG:DashboardServer  htpasswd  auth_basic_user_file  

猜你喜欢

相关文章