Issue:- 3scale APICAST gateway deployed as a docker in AWS ec2-instance using
docker run --name apicast --rm -p 8080:8080 -e THREESCALE_PORTAL_ENDPOINT=https://<access_token>@<3scaleonprem>-admin.3scale.net registry.redhat.io/3scale-amp2/apicast-gateway-rhel8:3scale2.9
Logging into the docker as root using
sudo docker exec -it -u root container-id bash
i make the following changes to /usr/local/openresty/nginx/conf/nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include 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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
lua_package_path "$prefix /lua/?.lua;;" ;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
include <nginx path>/myfolder/my.conf;
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
in my.conf
lua_need_request_body on;
set $my_response_body "";
body_filter_by_lua_file myfolder/my_body_filter.lua;
log_by_lua_file myfolder/my_log.lua;
However these lua files arent being triggered when the location / is hit from postman.Although i am able to get the response from the 3scale API management portal to which this apicast gateway is pointing.
Any reason why the nginx.conf file inside apicast docker container doesnt get triggered.Please note after making these changes i am running this to reload nginx for the changes to get reflected.
/usr/local/openresty/nginx/sbin/nginx -s reload
I have been stuck with this for quite some time.I am trying to send teh request and response to a server situated in AWS.However i aint able to even log the request or response in the logs even after trying a lot with some changes regarding logs as mentioned in nginx documentation.
Any idea if these changes have to be made somewhere else in apicast?The apicast documentation isnt at all helpful and even after browsing a lot i am unable to find the reason for this issue.