关于nginx的修改
11713
- Zeddicus2011-01-17金牌会员14416
看到有人问怎么改header,我也来说说。
src/core/nginx.h
#define NGINX_VERSION "0.7.62"
#define NGINX_VER "nginx/" NGINX_VERSION这个地方所更改的版本号,对应的是在显示504,404等错误的时候,显示在页面最下方的。但是即使你在这里改了,当你查看html文件的header的时候(用chrome浏览器邮件审查元素),依然是nginx。
如果要更改http response的header,就要改:
src/http/ngx_http_header_filter_module.c
这个地方的
static char ngx_http_server_string[] = "Server: nginx" CRLF;
static char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;最后,有兴趣的可以看看:
/src/http/ngx_http_special_response.c提示:可以定制原生的HTTP Status Code显示时的页面样式哦……
求加分……没法上图……
[ 本帖最后由 Zeddicus 于 2011-1-17 22:22 编辑 ]