Nginx Apache ab无法工作-ab:测试python cyclone时URL无效
我正在尝试测试旋风 当我跑的时候Nginx Apache ab无法工作-ab:测试python cyclone时URL无效,nginx,apachebench,cyclone,Nginx,Apachebench,Cyclone,我正在尝试测试旋风 当我跑的时候 ab -n 2000 -c 25 http://127.0.0.1 我得到ab:无效的URL 嗯…当我在我的开发机器上转到ff时,站点就在那里 这是我的nginx配置 http { upstream frontends { server 127.0.0.1:8051; } ## # Basic Settings ## sendfile on; tcp_nopush on; t
ab -n 2000 -c 25 http://127.0.0.1
我得到ab:无效的URL
嗯…当我在我的开发机器上转到ff时,站点就在那里
这是我的nginx配置
http {
upstream frontends {
server 127.0.0.1:8051;
}
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 30;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Only retry if there was a communication error, not a timeout
# on the Tornado server (to avoid propagating "queries of death"
# to all frontends)
proxy_next_upstream error;
server {
listen 80;
server_name 127.0.0.1;
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect false;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://frontends;
}
ab
需要在URL后面加一个斜杠
这应该起作用:
ab -n 2000 -c 25 http://127.0.0.1/
你会认为
ab
会很聪明地告诉你这一点,或者修复它。来吧,这甚至只是一行代码!为这个答案干杯。我遇到的问题是,我尝试的所有主机都没有尾部斜杠-谢谢!非常感谢。这就是我需要的。正如卢克所说,你认为它可能会解决这个问题。