如何解决NGINX:尝试访问 AWS Elasticsearch 域时出现 502 错误网关错误
我正在尝试使用反向代理来访问 AWS Elasticsearch。下面是我的default.conf
server {
listen 80;
listen 443 http2;
server_name ${DOLLAR}host;
rewrite ^/$ https://${DOLLAR}host/_plugin/kibana redirect;
location /_plugin/kibana {
# Forward requests to Kibana
proxy_pass https://${ESHost}/_plugin/kibana;
# Update cookie domain and path
proxy_cookie_domain ${ESHost} ${DOLLAR}host;
proxy_cookie_path / /_plugin/kibana/;
proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
proxy_set_header Host ${DOLLAR}host;
proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
# Response buffer settings
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
location ~ \/(log|sign|fav|forgot|change|saml|oauth2) {
# Handle redirects to Kibana
proxy_redirect https://${ESHost} https://${DOLLAR}host;
}
}
docker-entrypoint.sh
export DOLLAR='$'
envsubst < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
nginx -g "daemon off;"
但是当我尝试访问 url 时,我不断收到 502 Bad Gateway
。无法理解如何解决这个问题???
当我跑步时
nginx -t
我收到了这个回复:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。