nginx-hello-world-module | hello world module for learning Nginx module | Runtime Evironment library
kandi X-RAY | nginx-hello-world-module Summary
kandi X-RAY | nginx-hello-world-module Summary
This module serves as a learning exercise for me, and hopefully for others too, when doing Nginx module development. I stole the code and added some notes using mostly Evan Miller's Nginx Module Development Guide. Also helpful is the translation of Vhalery Kholodov's Nginx Module Guide done by Antoine Bonavita that also mantains a Nginx Discovery blog to document his journey on Nginx module development.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nginx-hello-world-module
nginx-hello-world-module Key Features
nginx-hello-world-module Examples and Code Snippets
Community Discussions
Trending Discussions on nginx-hello-world-module
QUESTION
I'm trying to build a web server with nginx.
My PC is a Mac OS so I just brew install nginx
. It works well. I can execute nginx
which is located at /usr/local/bin/
to start the server. Also, when I visit http://localhost
, I can get the main page, which is located at /usr/local/var/www/index.html
.
However, I can't find any source code of nginx.
So I download its source code from here.
Now I'm confused. I don't know how to organize my project.
For example, for this hello world, it just need #include #include #include
. It seems that it could use the source code of nginx as a c standard library.
How can I do the same thing?
Where should I put my developed module?
ANSWER
Answered 2017-Aug-16 at 20:18These two seems like very good starting point to me:
http://www.evanmiller.org/nginx-modules-guide.html
http://nutrun.com/weblog/2009/08/15/hello-world-nginx-module.html
I haven't made any modules myself, but when I searched for one of my own problem solution I found the above links and these looks promising to me.
I will update you any progress I made during my experiment. And if you have already made any progress, please do share.
QUESTION
I just download nginx. Then I go to the directory of nginx and do the three commands one by one as below:
ANSWER
Answered 2017-Apr-19 at 10:18It works for me!
Gives a file that contains hello world\0
...
Remember that the second time you run ./configure
you need to give all of the options again (it's replacing the config, not updating it).
Also you'll need to follow this with a make install
, otherwise the installed binary won't be updated.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nginx-hello-world-module
Configure Nginx adding this module with: Static Module : ./configure (...) --add-module=/path/to/nginx-hello-world-module Dynamic Module: ./configure (...) --add-dynamic-module=/path/to/nginx-hello-world-module
Build Nginx as usual with make.
Configure the module. There's only one directive hello_world that is supported in the location context only. Example: location = /test { hello_world; } Now doing something like: curl -i http://example.com/test should return the hello world string as the response body.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page