Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] nginx request location / not /nginx-status #1529

Open
1 task done
xiaochonzi opened this issue Feb 2, 2024 · 11 comments · Fixed by #1533
Open
1 task done

[BUG] nginx request location / not /nginx-status #1529

xiaochonzi opened this issue Feb 2, 2024 · 11 comments · Fixed by #1533
Labels
good first issue Good for newcomers question Further information is requested

Comments

@xiaochonzi
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

添加nginx监控,nginx那边配置了/nginx-status, 但是HertzBeat这边测试不通过。查看access.log发现请求的是/,而不是/nginx-status。同时修改过app-nginx.yaml中的url为/nginx-status,没有效果。
WX20240202-172415@2x

Expected Behavior

Steps To Reproduce

Environment

HertzBeat version(s): 1.4.4  使用docker部署的

Debug logs

Anything else?

@xiaochonzi xiaochonzi added the bug Something isn't working label Feb 2, 2024
@xiaochonzi xiaochonzi changed the title [BUG] request request location / not /nginx-status [BUG] nginx request location / not /nginx-status Feb 2, 2024
@tomsun28 tomsun28 added the good first issue Good for newcomers label Feb 2, 2024
@tomsun28
Copy link
Contributor

tomsun28 commented Feb 3, 2024

hi thanks for feedback, we will reproduce this and fix.

@tomsun28
Copy link
Contributor

tomsun28 commented Feb 3, 2024

hi, can not reproduce this, Please check whether nginx on your side has installed and enabled the http_stub_status_module module`

./configure --prefix=/usr/local/nginx --with-http_stub_status_module
make && make install

add config in nginx.conf

        location /nginx-status {
                stub_status     on;
                access_log      on;
                #allow 127.0.0.1;   #only allow requests from localhost
                #deny all;      #deny all other hosts
        }

@tomsun28 tomsun28 added question Further information is requested and removed bug Something isn't working labels Feb 3, 2024
@tomsun28
Copy link
Contributor

tomsun28 commented Feb 3, 2024

https://hertzbeat.com/docs/help/nginx/
sometime the nginx version not install the http_stub_status_module ngx_http_stub_status_module default, so we need to install it ourselves.

@tomsun28 tomsun28 linked a pull request Feb 4, 2024 that will close this issue
5 tasks
@xiaochonzi
Copy link
Author

我已经在nginx中加了上面配置,同时我自己访问都是ok的。然后我在hertbeat里配置nginx端口,使用hertbeat测试不通过。然后我查看了nginx的日志,发现请求的路径是/, 而不是/nginx-status。 同时我去查看hertbeat的日志,就是上面截图里的日志。

@hertzbeat
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I have added the above configuration to nginx, and it is ok for me to access it myself. Then I configured the nginx port in hertbeat, but the test using hertbeat failed. Then I checked the nginx log and found that the requested path was /, not /nginx-status. At the same time, I checked the log of hertbeat, which is the log in the screenshot above.

@xiaochonzi
Copy link
Author

xiaochonzi commented Feb 4, 2024

image 这是我在安装hertzbeat服务器进行curl测试,是没有问题的。 image 这是hertzbeat上nginx的配置 image 这是nginx测试时hertzbeat的配置。 同时,我的nginx配置只放开了/nginx-status路径,其他的/路径不允许访问。

@hertzbeat
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


image This is when I installed the hertzbeat server for curl testing, and there was no problem. ![image](https://github.com/dromara/hertzbeat/assets/16606871/8d6c4236-7a50-4fe1-a696-0a09a70911b7) This is the configuration of nginx on hertzbeat image This is the configuration of hertzbeat during nginx testing. At the same time, my nginx configuration only allows the /nginx-status path, and other / paths do not allow access.

@github-project-automation github-project-automation bot moved this from To do to Done in hertzbeat-v1.0 Feb 5, 2024
@tomsun28 tomsun28 reopened this Feb 5, 2024
@github-project-automation github-project-automation bot moved this from Done to In progress in hertzbeat-v1.0 Feb 5, 2024
@tomsun28
Copy link
Contributor

tomsun28 commented Feb 5, 2024

我已经在nginx中加了上面配置,同时我自己访问都是ok的。然后我在hertbeat里配置nginx端口,使用hertbeat测试不通过。然后我查看了nginx的日志,发现请求的路径是/, 而不是/nginx-status。 同时我去查看hertbeat的日志,就是上面截图里的日志。

hi, 我看nginx的监控模版,测试可用性的时候就是去访问的路径 / , 其它监控指标会去访问路径 /nginx-status

@hertzbeat
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I have added the above configuration to nginx, and it is ok for me to access it myself. Then I configured the nginx port in hertbeat, but the test using hertbeat failed. Then I checked the nginx log and found that the requested path was /, not /nginx-status. At the same time, I checked the log of hertbeat, which is the log in the screenshot above.

Hi, I looked at the nginx monitoring template. When testing availability, the access path is /. Other monitoring indicators will access the path /nginx-status.

@tomsun28
Copy link
Contributor

tomsun28 commented Feb 5, 2024

同时,我的nginx配置只放开了/nginx-status路径,其他的/路径不允许访问

你这个原因应该是因为这个,测试可用性时访问了路径 / ,而你那边配置不允许访问

@hertzbeat
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


At the same time, my nginx configuration only allows the /nginx-status path, and other / paths do not allow access.

Your reason is because of this. When testing availability, you accessed the path /, but your configuration does not allow access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants