[alibaba/tengine]tengine无法正常显示URI.. 我是不是发现了一个BUG呢?

2024-07-10 876 views
8

Tengin版本:tengine-2.1.2.tar.gz 问题描述: 使用firefox一切正常,使用chrome(58.0.3029.110 (64-bit))就会出现如下问题。

当我访问: "http://test.local.com/collecter/osobjs"的时候能够正常打印"/collecter/osobjs" ,但是当我访问 "http://test.local.com/collecter/osobjs/"的时候地址栏的地址就变成了 "http://test.local.com/search/error.html" 打印出来的URI也变成了"/search/error.html"。。。。 救济 谢谢了。。 我是不是发现了一个BUG呢?

nginx.conf

user  nginx;
worker_processes  auto;

events {
    worker_connections  1024;
}

http {
    #lua_code_cache off;
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    include conf.d/*.conf;
}`

conf.d/test.conf
`
server {
    listen       81;
    server_name  cmonitor.beta.iaas.jd.com;

    location / {
        default_type 'text/html'; 
        access_by_lua_file conf/lua/sso.lua;
    }
}`

sso.lua

[root@  xx.xx.xx conf]# cat lua/sso.lua 
-- Author:wanghaichao6
-- Create: 20170223
-- LastModifyu: 20170227
-- SSO

local http = require("resty.http")
local httpc = http.new()
local cjson = require("cjson")

ngx.say(ngx.var.uri)
ngx.exit(200)
[root@xxx# /export/servers/tengine/sbin/nginx -V
Tengine version: Tengine/2.1.2 (nginx/1.6.2)
built by gcc 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) 
TLS SNI support enabled
configure arguments: --prefix=/export/servers/tengine --with-http_lua_module --with-ld-opt=-Wl,-rpath,
loaded modules:
    ngx_core_module (static)
    ngx_errlog_module (static)
    ngx_conf_module (static)
    ngx_dso_module (static)
    ngx_syslog_module (static)
    ngx_events_module (static)
    ngx_event_core_module (static)
    ngx_epoll_module (static)
    ngx_procs_module (static)
    ngx_proc_core_module (static)
    ngx_openssl_module (static)
    ngx_regex_module (static)
    ngx_http_module (static)
    ngx_http_core_module (static)
    ngx_http_log_module (static)
    ngx_http_upstream_module (static)
    ngx_http_static_module (static)
    ngx_http_autoindex_module (static)
    ngx_http_index_module (static)
    ngx_http_auth_basic_module (static)
    ngx_http_access_module (static)
    ngx_http_limit_conn_module (static)
    ngx_http_limit_req_module (static)
    ngx_http_geo_module (static)
    ngx_http_map_module (static)
    ngx_http_split_clients_module (static)
    ngx_http_referer_module (static)
    ngx_http_rewrite_module (static)
    ngx_http_ssl_module (static)
    ngx_http_proxy_module (static)
    ngx_http_fastcgi_module (static)
    ngx_http_uwsgi_module (static)
    ngx_http_scgi_module (static)
    ngx_http_memcached_module (static)
    ngx_http_empty_gif_module (static)
    ngx_http_browser_module (static)
    ngx_http_user_agent_module (static)
    ngx_http_upstream_ip_hash_module (static)
    ngx_http_upstream_consistent_hash_module (static)
    ngx_http_upstream_check_module (static)
    ngx_http_upstream_least_conn_module (static)
    ngx_http_upstream_keepalive_module (static)
    ngx_http_upstream_dynamic_module (static)
    ngx_http_stub_status_module (static)
    ngx_http_write_filter_module (static)
    ngx_http_header_filter_module (static)
    ngx_http_chunked_filter_module (static)
    ngx_http_range_header_filter_module (static)
    ngx_http_gzip_filter_module (static)
    ngx_http_postpone_filter_module (static)
    ngx_http_ssi_filter_module (static)
    ngx_http_charset_filter_module (static)
    ngx_http_userid_filter_module (static)
    ngx_http_footer_filter_module (static)
    ngx_http_trim_filter_module (static)
    ngx_http_headers_filter_module (static)
    ngx_http_upstream_session_sticky_module (static)
    ngx_http_reqstat_module (static)
    ngx_http_lua_module (static)
    ngx_http_copy_filter_module (static)
    ngx_http_range_body_filter_module (static)
    ngx_http_not_modified_filter_module (static)`

回答

5

@huacnlee @mazhao @fsword @perusio @windyrobin 各位大神,能不能帮忙看看呢? 谢谢了。。

5

刚清空了chrome的缓存,然后就好了。 但是这个是为什么呢? 想不明白。。 就因为缓存折磨我几个小时。。。。 太shit了吧。。

0

怎么没有看到 80端口的配置文件? 还有复现吗? 如果清了cache就好了, 猜测会不是是一次请求因为什么原因5xx了, 被error_page到error.html错误页面. 然后浏览器缓存了 302.

2

这种情况下可以果断看access.log 和debug log 里面有确切的访问url,如果和浏览器访问不一致,即可判断出浏览器原因。