You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I return a status code other than 200, Nginx intercepts the request and show static nginx error file instead of my custom content generated in Ruby.
For example;
nginx.conf:
server {
location / {
mruby_content_handler "path/to/test.rb"; # or access_handler
}
}
test.rb:
classInvalidResponsedefcall(env)status=404# 404 File not Found.hash={success: false}headers={"Content-Type"=>"application/json"}body=[hash.to_json][status,headers,body]endendrunInvalidResponse.new
If I give 200 as a status then {success: false} shown on browser.
Isn't ngx_mruby capable of returning custom status codes with content?
P.S.: I also tried Nginx.return and Nginx.status_code. Neither worked.
The text was updated successfully, but these errors were encountered:
When I return a status code other than
200
, Nginx intercepts the request and show static nginx error file instead of my custom content generated in Ruby.For example;
nginx.conf:
test.rb:
If I give
200
as astatus
then{success: false}
shown on browser.Isn't ngx_mruby capable of returning custom status codes with content?
P.S.: I also tried
Nginx.return
andNginx.status_code
. Neither worked.The text was updated successfully, but these errors were encountered: