M
M
mrpsycho2014-12-10 15:53:59
Nginx
mrpsycho, 2014-12-10 15:53:59

Is it possible to write lua code in the nginx config that would just show the simplest form?

The question, as I understand it, is stupid.
but... I can't find the answer yet.
Not suitable for serious things... but for a home share on smb, it would be great to have a simple web form for resetting a user's password.
those, you need to have only 2 fields: login, new password.
and after clicking submit, calling the smbpasswd command.
Maybe?
or not steamed, and use php?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Nagaev, 2014-12-18
@mrpsycho

The answer is you can.
See wiki.nginx.org/HttpLuaModule
wiki.nginx.org/HttpLuaModule#ngx.print - to print something.
wiki.nginx.org/HttpLuaModule#ngx.req.get_post_args - access to data sent via POST
Lua function os.execute() - executes a command.
See the links above for examples of simple configs.
PS. You can write a full-fledged site on Lua: habrahabr.ru/post/240217

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question