File tree 3 files changed +427
-1
lines changed
3 files changed +427
-1
lines changed Original file line number Diff line number Diff line change 1
1
nginx post handler
2
2
=====
3
3
[ post_handler] ( https://github.com/aiwhj/post_handler.git ) 的 Nginx 版,嵌入了 PHP-embed,能对 HTTP 请求实现拦截,通过 Header 中是否有相应的 key,判断是否允许当次请求。
4
- 做这个的原因是想对 HTTP 大文件上传拦截。php-fpm 默认会直接上传文件,在传递 body 之前,先对 header 进行判断。
4
+ 做这个的原因是想对 HTTP 大文件上传拦截。php-fpm 默认会直接上传文件,在传递 body 之前,能先对 header 进行判断。
5
+
6
+ 扩展一下可以做成 Nginx 拓展版的 SAPI,类似 Apache 的 apache2handler。
5
7
6
8
## install
7
9
1 . 需要 PHP Embed SAPI 的共享库,可以实现通过 ` --enable-embed ` 编译出来共享库。
Original file line number Diff line number Diff line change
1
+ ngx_addon_name=ngx_http_post_handler_module
2
+ HTTP_MODULES="$HTTP_MODULES ngx_http_post_handler_module"
3
+ NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_post_handler_module.c"
4
+ CORE_INCS="$CORE_INCS /Users/roger/.phpbrew/php/php-7.1.15-embed/include/php/ \
5
+ /Users/roger/.phpbrew/php/php-7.1.15-embed/include/php/main \
6
+ /Users/roger/.phpbrew/php/php-7.1.15-embed/include/php/Zend \
7
+ /Users/roger/.phpbrew/php/php-7.1.15-embed/include/php/TSRM \
8
+ -Wall -g"
9
+ CORE_LIBS="$CORE_LIBS -lphp7"
You can’t perform that action at this time.
0 commit comments