# Web application to call C code

**URL:** <https://www.ruby-forum.com/t/web-application-to-call-c-code/243571>\
**Category:** NGINX\
**Created:** [December 5, 2015, 10:59pm UTC](https://www.ruby-forum.com/t/web-application-to-call-c-code/243571 "2015-12-05T22:59:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [December 5, 2015, 10:59pm UTC](https://www.ruby-forum.com/t/web-application-to-call-c-code/243571/1 "2015-12-05T22:59:20Z")

</div>

I am writing a web application and am interested in whether I can use  
nginx. For each request for the web server, I want it to call some C  
code I have written. The code C will generate the HTML I want to send  
back. Is there a simple way to do this?

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 6, 2015, 11:24am UTC](https://www.ruby-forum.com/t/web-application-to-call-c-code/243571/2 "2015-12-06T11:24:44Z")

</div>

Hi.

Am 05-12-2015 22:59, schrieb [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I am writing a web application and am interested in whether I can use  
> nginx. For each request for the web server, I want it to call some C  
> code I have written. The code C will generate the HTML I want to send  
> back. Is there a simple way to do this?

I see at least 2 options.

1.) Write a nginx module like ngx\_http\_empty\_gif\_module or any other  
nginx module.

```
 http://nginx.org/en/docs/http/ngx_http_empty_gif_module.html

```

> **[hg.nginx.org is decommissioned](http://hg.nginx.org/nginx/file/tip/src/http/modules/ngx_http_empty_gif_module.c)**

2.) use a more dedicated server like [G-WAN \> Web Application Server \> Developers](http://gwan.ch/developers)

On which platform do you plan to run your C-Code ?

Cheers Aleks

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 5, 2015, 11:45pm UTC](https://www.ruby-forum.com/t/web-application-to-call-c-code/243571/3 "2015-12-05T23:45:29Z")

</div>

Your better of with Lua (embedded in nginx), search for openresty.

Posted at Nginx Forum:

> **[Re: web application to call C code](https://forum.nginx.org/read.php?2,263295,263296#msg-263296)**
>
> I am writing a web application and am interested in whether I can use nginx. For each request for the web server, I want it to call some C code I have written. The code C will generate the HTML I want to send back. Is there a simple way to do this?...
