<div dir="ltr">Hello.<div><br></div><div>You need to set the content-type to this location. e.g.:</div><div><br></div><div>add_header Content-Type text/plain;</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2014-01-27 Shohreh <span dir="ltr"><<a href="mailto:nginx-forum@nginx.us" target="_blank">nginx-forum@nginx.us</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello<br>
<br>
Now that I have a working Nginx with the ngx_lua module, I'd like to start<br>
learning how to write web scripts.<br>
<br>
The following page doesn't have a basic sample:<br>
<a href="http://wiki.nginx.org/HttpLuaModule" target="_blank">http://wiki.nginx.org/HttpLuaModule</a><br>
<br>
So I used the following...<br>
<a href="http://yichunzhang.wordpress.com/2010/05/18/a-simple-ngx_lua-example-for-the-future/" target="_blank">http://yichunzhang.wordpress.com/2010/05/18/a-simple-ngx_lua-example-for-the-future/</a><br>
... to edit nginx.conf and write a basic hello.lua file:<br>
<br>
================ nginx.conf<br>
...<br>
    server {<br>
        listen       12345;<br>
        server_name  localhost;<br>
<br>
        location / {<br>
            root   html;<br>
            index  index.html index.htm;<br>
            content_by_lua_file hello.lua;<br>
        }<br>
...<br>
================ html/hello.lua<br>
print("Hello, world!")<br>
================<br>
<br>
But when I call <a href="http://192.168.0.10:12345/hello.lua" target="_blank">http://192.168.0.10:12345/hello.lua</a>, Chrome downloads the<br>
file instead of displaying the output.<br>
<br>
What should I do?<br>
<br>
Thank you.<br>
<br>
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,246864,246864#msg-246864" target="_blank">http://forum.nginx.org/read.php?2,246864,246864#msg-246864</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>att.<br></div>Jader H. Silva<br></div>
</div>