All Projects → webcpp → Hi Nginx

webcpp / Hi Nginx

Licence: other
A fast and robust web server and application server for C++,Python,Lua ,Java,quickjs language

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
java
68154 projects - #9 most used programming language
c
50402 projects - #5 most used programming language
lua
6591 projects
cpp
1120 projects
groovy
2714 projects

Projects that are alternatives of or similar to Hi Nginx

Uwsgi Nginx Docker
Docker image with uWSGI and Nginx for applications in Python 3.5 and above and Python 2.7 (as Flask) in a single container. Optionally with Alpine Linux.
Stars: ✭ 466 (+34.68%)
Mutual labels:  server, nginx, web-server
Local Web Server
A lean, modular web server for rapid full-stack development.
Stars: ✭ 916 (+164.74%)
Mutual labels:  server, web-server
Nginx Rtmp Docker
Docker image with Nginx using the nginx-rtmp-module module for live multimedia (video) streaming.
Stars: ✭ 506 (+46.24%)
Mutual labels:  server, nginx
Hummingbird
Lightweight, flexible HTTP server framework written in Swift
Stars: ✭ 114 (-67.05%)
Mutual labels:  server, web-server
Hyperfastcgi
Performant nginx to mono fastcgi server
Stars: ✭ 125 (-63.87%)
Mutual labels:  nginx, web-server
Binserve
A blazingly fast static web server with routing, templating, and security in a single binary you can set up with zero code. ⚡️🦀
Stars: ✭ 401 (+15.9%)
Mutual labels:  server, web-server
Knowledge
文档着重构建一个完整的「前端技术架构图谱」,方便 F2E(Front End Engineering又称FEE、F2E) 学习与进阶。
Stars: ✭ 1,620 (+368.21%)
Mutual labels:  server, nginx
Web Server Bundle
WebServerBundle provides commands for running applications using the PHP built-in web server. It simplifies your local development setup because you don't have to configure a proper web server such as Apache or Nginx to run your application.
Stars: ✭ 1,281 (+270.23%)
Mutual labels:  server, web-server
Myserver
MyServer is your own localhost web server. you can setup PHP, Apache, Nginx and MySQL servers on your android devices or linux like Ubuntu etc. MyServer is Developed for android terminal like Termux or GNURoot Debian terminal.
Stars: ✭ 160 (-53.76%)
Mutual labels:  server, web-server
Thin
A very fast & simple Ruby web server
Stars: ✭ 2,170 (+527.17%)
Mutual labels:  server, web-server
Heimdall
As the name suggests Heimdall Application Dashboard is a dashboard for all your web applications. It doesn't need to be limited to applications though, you can add links to anything you like.
Stars: ✭ 3,501 (+911.85%)
Mutual labels:  server, nginx
Dockerweb
A docker-powered bash script for shared web hosting management. The ultimate Docker LAMP/LEMP Stack.
Stars: ✭ 89 (-74.28%)
Mutual labels:  nginx, web-server
Hestiacp
Hestia Control Panel | A lightweight and powerful control panel for the modern web.
Stars: ✭ 764 (+120.81%)
Mutual labels:  nginx, web-server
Config
Armbian configuration utility
Stars: ✭ 317 (-8.38%)
Mutual labels:  server, nginx
Magento 2 Server Installation
Magento 2 Server Installation - How to Install Magento 2
Stars: ✭ 123 (-64.45%)
Mutual labels:  server, nginx
Webinoly
Optimized LEMP Web Server to manage your WordPress, PHP, or simple HTML sites running on a powerful NGINX setup.
Stars: ✭ 254 (-26.59%)
Mutual labels:  nginx, web-server
Nock Nock
🚪 Monitor and validate your websites to maintain maximum uptime.
Stars: ✭ 339 (-2.02%)
Mutual labels:  server, web-server
Devilbox
A modern Docker LAMP stack and MEAN stack for local development
Stars: ✭ 3,598 (+939.88%)
Mutual labels:  nginx
Ngx php7
ngx_php7 - Embedded php7 scripting language for nginx module. Mainline development version of the ngx_php.
Stars: ✭ 337 (-2.6%)
Mutual labels:  nginx
Akarin
Akarin is a powerful (not yet) server software from the 'new dimension'
Stars: ✭ 332 (-4.05%)
Mutual labels:  server

Features

  • All features of nginx(latest release) are inherited, i.e., it is 100% compatible with nginx.
  • Web development using python, c++, lua, java , quickjs

Dependency

  • linux
  • gcc and g++(c++11) or clang and clang++
  • python-devel,if --enable-http-hi-python=YES and with-http-hi-python-version=python2
  • python3.x-devel if --enable-http-hi-python=YES and with-http-hi-python-version=python3(or python3-embed)
  • lua-devel(lua5.x),if --enable-http-hi-lua=YES and --with-http-hi-lua-version=lua5.x
  • luajit-devel,if --enable-http-hi-lua=YES and --with-http-hi-lua-version=luajit
  • jdk 8+,if --enable-http-hi-java=YES

Installation

./configure --help or see install_demo.sh or

                --enable-http-hi-cpp=YES                           \
                --enable-http-hi-python=NO                         \
                --enable-http-hi-lua=NO                            \
                --enable-http-hi-qjs=YES                            \
                --enable-http-hi-java=NO                           \
                --with-http-hi-python-version=python3              \
                --with-http-hi-lua-version=lua5.3                  \
                --add-module=module/ngx_http_hi_module             \
                --add-module=module/ngx_autoblacklist_module               

python, lua api

hi_req

  • uri
  • method
  • client
  • param
  • user_agent
  • has_header
  • get_header
  • has_form
  • get_form
  • has_session
  • get_session
  • has_cookie
  • get_cookie
  • has_cache
  • get_cache

hi_res

  • status
  • content
  • header
  • session
  • cache

quickjs api

hi

  • uri
  • method
  • client
  • param
  • user_agent
  • has_header
  • get_header
  • has_form
  • get_form
  • has_session
  • get_session
  • has_cookie
  • get_cookie
  • has_cache
  • get_cache
  • status
  • content
  • header
  • session
  • cache

hello,world

cpp servlet class

#include "servlet.hpp"
namespace hi{
class hello : public servlet {
    public:

        void handler(request& req, response& res) {
            res.headers.find("Content-Type")->second = "text/plain;charset=UTF-8";
            res.content = "hello,world";
            res.status = 200;
        }

    };
}

extern "C" hi::servlet* create() {
    return new hi::hello();
}

extern "C" void destroy(hi::servlet* p) {
    delete p;
}

cpp compile

g++ -std=c++11 -I/usr/local/nginx/include  -shared -fPIC hello.cpp -o hello.so
install hello.so /usr/local/nginx/cpp

java servlet class

package hi;

import hi.servlet;
import hi.request;
import hi.response;

public class jhello implements hi.servlet {

    public jhello() {

    }

    public void handler(hi.request req, hi.response res) {
        res.status = 200;
        res.content = "hello,world";

    }
}

quickjs

import * as hi from "hi";
hi.header('Content-Type','text/plain;charset=UTF-8')
hi.content('hello,world')
hi.status(200)

python

hi_res.status(200)
hi_res.content("hello,world")

example

pyexample

lua

hi_res:status(200)
hi_res:content("hello,world")

3rd party module

  • nginx-push-stream-module
  • ngx_http_concat_module
  • ngx_http_footer_filter_module
  • ngx_http_trim_filter_module
  • ngx_slab_stat
  • 3rd

ngx_http_hi_module directives

  • directives : content: loc,if in loc

    • hi,default: ""

    example:

            location = /hello {
                hi cpp/hello.so ;
            }

  • directives : content: http,srv,loc,if in loc ,if in srv

    • hi_need_tokens,default: on

    example:

        hi_need_tokens on|off;

  • directives : content: http,srv,loc,if in loc ,if in srv

    • hi_cache_method,default: GET

    example:

        hi_cache_method GET|POST|PUT|HEAD;

  • directives : content: http,srv,loc,if in loc ,if in srv

    • hi_need_cache,default: on

    example:

        hi_need_cache on|off;

  • directives : content: http,srv,loc,if in loc ,if in srv

    • hi_cache_size,default: 10

    example:

        hi_cache_size 10;

  • directives : content: http,srv,loc,if in loc ,if in srv

    • hi_cache_expires,default: 300s

    example:

        hi_cache_expires 300s;

  • directives : content: http,srv,loc,if in loc ,if in srv

    • hi_need_kvdb,default: off

    example:

        hi_need_kvdb on|off;

  • directives : content: http,srv,loc,if in loc ,if in srv

    • hi_kvdb_size,default: 10

    example:

        hi_kvdb_size 10;

  • directives : content: http,srv,loc,if in loc ,if in srv

    • hi_kvdb_expires,default: 300s

    example:

        hi_kvdb_expires 300s;

  • directives : content: http,srv,loc,if in loc ,if in srv
    • hi_need_headers,default: off

      example:

        hi_need_headers on|off;

  • directives : content: http,srv,loc,if in loc ,if in srv
    • hi_need_cookies,default: off

      example:

        hi_need_cookies on|off;

  • directives : content: http,srv,loc,if in loc ,if in srv
    • hi_need_session,default: off

      example:

        hi_need_session on|off;

  • directives : content: http,srv,loc,if in loc ,if in srv

    • hi_session_expires,default: 300s

    example:

        hi_session_expires 300s;

  • directives : content: loc,if in loc

    • hi_python_content,default: ""

    example:

            location = /pyecho {
                hi_python_content "hi_res.status(200)\nhi_res.content('hello,world')" ;
            }

  • directives : content: loc,if in loc

    • hi_python_script,default: ""

    example:

            location ~ \.py$  {
                hi_python_script python;
            }

or

            location / {
                hi_python_script python/index.py;
            }

  • directives : content: http,srv,if in srv

    • hi_lua_package_path,default: ""

    example:

            hi_lua_package_path '/usr/local/nginx/lua/?.lua;';


  • directives : content: http,srv,if in srv

    • hi_lua_package_cpath,default: ""

    example:

            hi_lua_package_cpath '/usr/local/nginx/lua/?.so;';


  • directives : content: loc,if in loc

    • hi_lua_content,default: ""

    example:

            location = /luaecho {
                hi_lua_content "hi_res:status(200)\nhi_res:content('hello,world')" ;
            }

  • directives : content: loc,if in loc

    • hi_lua_script,default: ""

    example:

            location ~ \.lua$  {
                hi_lua_script lua;
            }

or

            location / {
                hi_lua_script lua/index.lua;
            }

  • directives : content: http,srv,if in srv

    • hi_java_classpath,default:"-Djava.class.path=."

    example:

hi_java_classpath "-Djava.class.path=.:/usr/local/nginx/java:/usr/local/nginx/java/hi-nginx-java.jar";


  • directives : content: http,srv,if in srv

    • hi_java_options,default:"-server -d64 -Xmx1G -Xms1G -Xmn256m"

    example:

hi_java_options "-server -d64 -Xmx3G -Xms3G -Xmn768m -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseNUMA -XX:+CMSParallelRemarkEnabled -XX:MaxTenuringThreshold=15 -XX:MaxGCPauseMillis=30 -XX:GCPauseIntervalMillis=150 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true -XX:+UseFastAccessorMethods -XX:+UseCompressedOops -XX:+OptimizeStringConcat -XX:+AggressiveOpts -XX:ReservedCodeCacheSize=2048m -XX:+UseCodeCacheFlushing -XX:SoftRefLRUPolicyMSPerMB=10000 -XX:ParallelGCThreads=10";


  • directives : content: loc,if in loc

    • hi_java_servlet,default:""

    example:

hi_java_servlet hi/jhello;



  • directives : content : http,srv,loc,if in loc ,if in srv

    • hi_java_servlet_cache_expires,default:300s

    example:

hi_java_servlet_cache_expires 300s;


  • directives : content : http,srv,loc,if in loc ,if in srv

    • hi_java_servlet_cache_size,default:10

    example:

hi_java_servlet_cache_size 10;


  • directives : content: http,srv,if in srv

    • hi_java_version,default:8

    example:

hi_java_version 8;


  • directives : content: loc,if in loc

    • hi_qjs_script,default: ""

    example:

            location ~ \.js$  {
                hi_qjs_script qjs;
            }

or

            location / {
                hi_qjs_script qjs/index.js;
            }
  • directives : content: http,srv,if in srv

    • hi_qjs_memory_limit ,default: 1024m

    example:

            hi_qjs_memory_limit 1024m;


  • directives : content: http,srv,if in srv

    • hi_qjs_stack_limit ,default: 8m

    example:

            hi_qjs_stack_limit 8m;


  • directives : content: http,srv,if in srv

    • hi_qjs_ctx_called_limit,default: 10240

    example:

            hi_qjs_ctx_called_limit 10240;


  • directives : content: loc if in loc

    • hi_subrequest, default : ""

    example:

        location ^~ /sub {
                hi_subrequest '/query';
                hi_lua_content 'hi_res:header("Content-Type",hi_req:get_form("__subrequest_content_type__"))\nhi_res:status(tonumber(hi_req:get_form("__subrequest_status__")))\nhi_res:content(hi_req:get_form("__subrequest_body__"))';
        }

        location ^~ /query {
                internal;
                proxy_pass http://http://hq.sinajs.cn/;
                proxy_set_header Accept-Encoding '';
        }
#  curl -i http://localhost/sub?list=sh601006

ngx_http_autoblacklist_module directives

  • directives : content: http,srv,loc,if in loc ,if in srv

    • autoblacklist, default : "off"
    • autoblacklist_size, default : 1024
    • autoblacklist_limit, default : 30
    • autoblacklist_expires, default : 86400s

    example:

	autoblacklist on|off;
	autoblacklist_size 1024;
	autoblacklist_expires 86400s;
	autoblacklist_limit 30;

nginx.conf

hi_demo_conf

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].