# Need help with writing module

**URL:** <https://www.ruby-forum.com/t/need-help-with-writing-module/220800>\
**Category:** NGINX\
**Created:** [June 20, 2012, 7:24pm UTC](https://www.ruby-forum.com/t/need-help-with-writing-module/220800 "2012-06-20T19:24:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [June 20, 2012, 7:24pm UTC](https://www.ruby-forum.com/t/need-help-with-writing-module/220800/1 "2012-06-20T19:24:06Z")

</div>

I am new to nginx. This going to be my first module. What would be best  
way to write it? When there is specific http requeset, module should  
open file and read the tex from it, and write some text to the file. It  
should write it after specific text that is why it needs to read text  
from file. I could not find any info on how to use files in modules.

Thank you very much.

Posted at Nginx Forum:

> **[Need help with writing module](https://forum.nginx.org/read.php?2,227728,227728#msg-227728)**
>
> I am new to nginx. This going to be my first module. What would be best way to write it? When there is specific http requeset, module should open file and read the tex from it, and write some text to the file. It should write it after specific text...

---

<div class="post-metadata">

**Author:** ![munkhabi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/13edae/32.png) [@munkhabi](https://www.ruby-forum.com/u/munkhabi)\
**Post date:** [June 20, 2012, 7:38pm UTC](https://www.ruby-forum.com/t/need-help-with-writing-module/220800/2 "2012-06-20T19:38:08Z")

</div>

Forgot to add. I do not want to use FastCGI or anything like it.

Posted at Nginx Forum:

> **[Re: Need help with writing module](https://forum.nginx.org/read.php?2,227728,227730#msg-227730)**
>
> I am new to nginx. This going to be my first module. What would be best way to write it? When there is specific http requeset, module should open file and read the tex from it, and write some text to the file. It should write it after specific text...

---

<div class="post-metadata">

**Author:** ![munkhabi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/13edae/32.png) [@munkhabi](https://www.ruby-forum.com/u/munkhabi)\
**Post date:** [June 20, 2012, 8:45pm UTC](https://www.ruby-forum.com/t/need-help-with-writing-module/220800/3 "2012-06-20T20:45:54Z")

</div>

> I am new to nginx. This going to be my first module. What would be best  
> way to write it? When there is specific http requeset, module should  
> open file and read the tex from it, and write some text to the file. It  
> should write it after specific text that is why it needs to read text  
> from file. I could not find any info on how to use files in modules.

Unless there are some specific reasons it seems it would be more simple  
for  
you to add such feature via the embedded perl (  
[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpPerlModule) ) or lua module (  
[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpLuaModule) ).

rr
