Hi All,
I am beginner with nginx/openresty.
want to use lua files with openresty 1-21.4.1
I have a simple hello.lua file as shown below.
#!/usr/bin/lua
print ("Content-type: test/plain\n\n")
print ("hello World")
my nginx.conf is as below
user labuser;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
#root html;
#index index.html index.htm;
default_type text/plain;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
syntax is coming as ok
but when I try to access this file like localhost/hello.lua , its printing all the file contents
instead of the just printing helloworld.
Any steps I am missing here.
Thanks