I am using php in nginx. I wonder how can I modify nginx configuration
to work with C too. Considered a simple c file (hello.c and compiled as
a.out) with printf of
I am using php in nginx. I wonder how can I modify nginx
configuration to work with C too. Considered a simple c file
(hello.c and compiled as a.out) with printf of
I am using php in nginx. I wonder how can I modify nginx configuration
to work with C too. Considered a simple c file (hello.c and compiled as
a.out) with printf of
how can I display Hello World by browsing the compiled version on
localhost/a.out
The best solution probably depends on what you’re trying to achieve and
your particular circumstances. As well as the solutions already
suggested, one method I’ve used is to build the C program against
libevent, effectively using libevent to build a mini webserver that is
running all the time. nginx can then use that as an upstream proxy.
Thanks James!
The idea of building a mini-webserver for C programming is brilliant. I
searched a lot to find a guidance for building very basic web server in
C (obviously I prefer to write the web server in C with native API for C
files); but I was unable to find. All web servers in C are advanced
applications such as nginx. Could you please give me a hint how to start
to write a mini web server in C.
The idea of building a mini-webserver for C programming is brilliant. I
searched a lot to find a guidance for building very basic web server in
C (obviously I prefer to write the web server in C with native API for C
files); but I was unable to find. All web servers in C are advanced
applications such as nginx. Could you please give me a hint how to start
to write a mini web server in C.
Thanks James!
The idea of building a mini-webserver for C programming is brilliant. I
searched a lot to find a guidance for building very basic web server in
C (obviously I prefer to write the web server in C with native API for C
files); but I was unable to find. All web servers in C are advanced
applications such as nginx. Could you please give me a hint how to start
to write a mini web server in C.
libevent has all of the hard stuff done for you. You basically just
need to use it’s API to get hold of all the HTTP request information
and to let it handle the response to the user.
On Saturday 03 December 2011 16:44:56 etrader wrote:
Thanks James!
The idea of building a mini-webserver for C programming is brilliant. I
searched a lot to find a guidance for building very basic web server in
C (obviously I prefer to write the web server in C with native API for C
files); but I was unable to find. All web servers in C are advanced
applications such as nginx. Could you please give me a hint how to start
to write a mini web server in C.
Instead of building a web server, you can consider to write a fastcgi
or scgi application.
You will end with items passed by nginx to your app easy accessible and
you will not need to learn how to program a server/daemon
and focus on your app.
In addition to this your app will be accessibile via uwsgi/http/fastcgi
and can use the whole uwsgi api and operational modes
(preforked/threaded/async/green).
The doc on writing plugins is not available, but you can subscribe to
the
uWSGI list and ask for help (or read the sources of the other plugins).