pas*_*una 27 nginx code-injection
有没有办法为每个服务的php/html/etc注入几行脚本等.页?例如一些自定义的javascript在-tag之后?
我知道,你应该能够在nginx中使用lua但是有更好的解决方案吗?
我在nginx后面运行多个不同的Web应用程序,所以感觉这是正确的方法.我没有每个应用程序的访问源代码,维护这些代码会很麻烦.
pas*_*una 37
我找到了这样做的方法:http://nginx.org/en/docs/http/ngx_http_sub_module.html
location / {
sub_filter </head>
'</head><script language="javascript" src="$script"></script>';
sub_filter_once on;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14076 次 |
| 最近记录: |