nginxで/etc/nginx/conf.d/apply.conf
で以下のように書いています。
server { location /hoge { return 200; } }
しかし起動させても
curl localhost:80/hoge
とやっても
<html> <head><title>404 Not Found</title></head> <body bgcolor="white"> <center><h1>404 Not Found</h1></center> <hr><center>nginx/1.13.9</center> </body> </html>
が返ってきます。どのように設定すればステータスコードを200にできるでしょうか?
ヘルスチェック用なので、何も返す必要がありません。
よろしくお願いたします。
追記です。/etc/ngnix/nginx.conf
は以下のようになっています。
user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout 65; include /etc/nginx/conf.d/*.conf; }