Hi,
I am new to openresty, I was trying to get a http server listening on port 80 and a tcp server listening on port 12341.
I have compiled openresty (openresty-1.11.2.2) with build option mentioned below:
./configure -j2 --with-pcre-jit
--with-ipv6
--with-threads
--with-luajit
--with-ld-opt="-Wl,-rpath,/usr/local/openresty/luajit/lib/"
--with-stream
--add-module=$PWD/bundle/stream-lua-nginx-module-0.0.1
While testing the nginx.conf I am getting this error
$: sudo nginx -t -c pwd
/nginx.conf
nginx: [emerg] unknown directive "stream" in /usr/local/openresty/nginx/conf/nginx.conf:20
nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed
nginx.confg:
_user www-data;
worker_processes auto;
pid /run/openresty.pid;
events {
worker_connections 1024;
}
stream {
# define a TCP server listening on the port 1234:
server {
listen 12341;
content_by_lua_block {
ngx.say("Hello, Lua!")
}
}
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/openresty/access.log;
error_log /var/log/openresty/error.log;
gzip on;
gzip_disable "msie6";
include ../sites/default.conf;
server {
listen 8080;
location / {
default_type text/html;
content_by_lua '
ngx.say("<p>hello, world</p>")
';
}
}
}_
I am trying to terminate http on openresty and just fwd the http body to the client which connect over tcp to openresty.
I am not sure if this is version mismatch issue. Not sure if streams module works with openresty version 1.11.2.2. Can I get some help on the same?
Regards,
Badari