mikyll commented on issue #12279:
URL: https://github.com/apache/apisix/issues/12279#issuecomment-2940086443

   That's some weird behaviour 🤔 I tried some stuff but couldn't manage to 
reproduce the issue...
   
   The HTML response you provided is the _default APISIX response format_. This 
is returned, for example, when APISIX truncates the request and responds 
directly without propagating it to upstream. Here's an example, using 
`serverless-pre-function` plugin:
   
   ```bash
   hostname="my_hostname"
   admin_key="my_apikey"
   
   curl "http://${hostname}:9180/apisix/admin/routes/1"; -H "X-API-KEY: 
${admin_key}" -X PUT -i -d '
   {
       "uri": "/test",
       "upstream": {
           "nodes": {
               "httpbin.org": 1
           }
       },
       "plugins": {
           "serverless-pre-function": {
               "phase": "header_filter",
               "functions": [
                   "return function(conf, ctx); local core = 
require(\"apisix.core\");  local status_code = 200; if ctx.var.arg_status_code 
and ctx.var.arg_status_code ~= \"\" then; status_code = 
tonumber(ctx.var.arg_status_code); end; ngx.exit(status_code); end"
               ]
           }
       }
   }'
   ```
   
   And you send a request to `/test?status_code=403`:
   
   ```bash
   curl -i "http://${hostname}/test?status_code=403";
   ```
   
   You get the following HTML response:
   
   ```bash
   HTTP/1.1 403 Forbidden
   ...
   
   <html>
   <head><title>403 Forbidden</title></head>
   <body>
   <center><h1>403 Forbidden</h1></center>
   <hr><center>openresty</center>
   <p><em>Powered by <a 
href="https://apisix.apache.org/";>APISIX</a>.</em></p></body>
   </html>
   ```
   
   ---
   
   Some more stuff you could try is the following:
   - check APISIX logs
   - set some sort of port-forwarding (if needed) and try accessing the Admin 
API directly on port 9180
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to