Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all 7229 articles
Browse latest View live

websocket causes "client sent invalid method ..." (no replies)

$
0
0
Hello,

I'm trying setup nginx for socket proxy. I was able to find that nginx can be configured to proxy websockets and added an error log file in the server configuration block to isolate the messages, and I get:

client sent invalid method while reading client request line, client: XX.XX.XX.1, server: , request: ҁb▒▒"

in the access logs I see:

XX.XX.XX.1 - - [30/Jun/2015:17:39:15 -0400] "\x00\x08\x1B\x19\x94\xD2\x81b\xBD\xF3" 400 172 "-" "-" "-"

The software that is I need to proxy is a remote assistant application with a web servlet running inside tomcat and with two client applications, one admin and one user, that connect to the server and communicate.

Is there anything that can be done to make it work?

Thank you in advance.

nginx-1.9.2 + ssl + spdy segfault (no replies)

$
0
0
Segfault in nginx-1.9.2 with ssl and spdy module

# nginx -V
nginx version: nginx/1.9.2
built by gcc 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --user=nginx --group=nginx --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_realip_module --with-debug --with-ipv6 --with-http_spdy_module --add-module=/home/buildbot/rpm//BUILD/lua-nginx-module-0.9.16 --add-module=/home/buildbot/rpm//BUILD/ngx_devel_kit-0.2.14

# gdb nginx nginx.core
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/local/nginx/sbin/nginx...done.
[New Thread 24331]

...

#0 ngx_http_spdy_close_stream_handler (ev=0x754eb58) at src/http/ngx_http_spdy.c:3353
3353 src/http/ngx_http_spdy.c: No such file or directory.
in src/http/ngx_http_spdy.c
Missing separate debuginfos, use: debuginfo-install nginx-rb-1.9.52-1.x86_64
(gdb) directory nginx-1.9.2
Source directories searched: nginx-1.9.2:$cdir:$cwd
(gdb) bt
#0 ngx_http_spdy_close_stream_handler (ev=0x754eb58) at src/http/ngx_http_spdy.c:3353
#1 0x0000000000482562 in ngx_http_spdy_write_handler (wev=<value optimized out>) at src/http/ngx_http_spdy.c:649
#2 0x0000000000435f26 in ngx_event_process_posted (cycle=0xcc6a20, posted=0x76fcd0) at src/event/ngx_event_posted.c:33
#3 0x000000000043ce85 in ngx_worker_process_cycle (cycle=0xcc6a20, data=<value optimized out>) at src/os/unix/ngx_process_cycle.c:769
#4 0x000000000043b234 in ngx_spawn_process (cycle=0xcc6a20, proc=0x43cdb0 <ngx_worker_process_cycle>, data=0x10, name=0x4f98b3 "worker process", respawn=-4) at src/os/unix/ngx_process.c:198
#5 0x000000000043c1cc in ngx_start_worker_processes (cycle=0xcc6a20, n=23, type=-4) at src/os/unix/ngx_process_cycle.c:358
#6 0x000000000043dbd8 in ngx_master_process_cycle (cycle=0xcc6a20) at src/os/unix/ngx_process_cycle.c:243
#7 0x000000000041b856 in main (argc=<value optimized out>, argv=<value optimized out>) at src/core/nginx.c:415
(gdb) list
3348 ngx_http_request_t *r;
3349
3350 fc = ev->data;
3351 r = fc->data;
3352
3353 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
3354 "spdy close stream handler");
3355
3356 ngx_http_spdy_close_stream(r->spdy_stream, 0);
3357 }
(gdb) p r
$1 = (ngx_http_request_t *) 0x0
(gdb) p fc
$2 = (ngx_connection_t *) 0x754ea20
(gdb) p *fc
$3 = {data = 0x0, read = 0x754eaf8, write = 0x754eb58, fd = 1041, recv = 0x4424e0 <ngx_ssl_recv>, send = 0x441e90 <ngx_ssl_write>, recv_chain = 0x442990 <ngx_ssl_recv_chain>, send_chain = 0x484830 <ngx_http_spdy_send_chain>, listening = 0xcc6f00, sent = 16770,
log = 0x754ebb8, pool = 0x1edb9a0, sockaddr = 0x1edb9f0, socklen = 16, addr_text = {len = 11, data = 0x1edba50 "83.149.9.264"}, proxy_protocol_addr = {len = 0, data = 0x0}, ssl = 0x53307b8, local_sockaddr = 0xe773e0, local_socklen = 16, buffer = 0x0, queue = {
prev = 0x0, next = 0x0}, number = 68976568, requests = 7, buffered = 2, log_error = 2, unexpected_eof = 0, timedout = 0, error = 1, destroyed = 1, idle = 0, reusable = 0, close = 0, sendfile = 1, sndlowat = 1, tcp_nodelay = 2, tcp_nopush = 0, need_last_buf = 1}
(gdb) p ev
$4 = (ngx_event_t *) 0x754eb58
(gdb) p *ev
$5 = {data = 0x754ea20, write = 1, accept = 0, instance = 0, active = 0, disabled = 0, ready = 1, oneshot = 0, complete = 0, eof = 0, error = 0, timedout = 0, timer_set = 0, delayed = 0, deferred_accept = 0, pending_eof = 0, posted = 0, closed = 0, channel = 0,
resolver = 0, cancelable = 0, available = 0, handler = 0x47ed90 <ngx_http_spdy_close_stream_handler>, index = 0, log = 0x754ebb8, timer = {key = 0, left = 0x0, right = 0x0, parent = 0x0, color = 0 '\000', data = 0 '\000'}, queue = {prev = 0x0, next = 0x0}}
(gdb) f 1
#1 0x0000000000482562 in ngx_http_spdy_write_handler (wev=<value optimized out>) at src/http/ngx_http_spdy.c:649
649 wev->handler(wev);
(gdb) list
644
645 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
646 "run spdy stream %ui", stream->id);
647
648 wev = stream->request->connection->write;
649 wev->handler(wev);
650 }
651
652 sc->blocked = 0;
653
(gdb) p wev
$6 = <value optimized out>
(gdb) p stream
$7 = (ngx_http_spdy_stream_t *) 0x66a7150
(gdb) p *stream
$8 = {id = 13, request = 0x66a64c0, connection = 0x39861e0, index = 0x0, header_buffers = 0, queued = 0, send_window = 40500, recv_window = 2147483647, free_frames = 0x10ec518, free_data_headers = 0x10ec558, free_bufs = 0x10ec4b8, queue = {prev = 0x0, next = 0x0},
priority = 4, handled = 0, blocked = 0, exhausted = 0, in_closed = 1, out_closed = 1, skip_data = 1}
(gdb) p stream->request
$9 = (ngx_http_request_t *) 0x66a64c0
(gdb) p *stream->request
$10 = {signature = 1347703880, connection = 0x754ea20, ctx = 0x66a6df8, main_conf = 0xcc76e0, srv_conf = 0xd2a178, loc_conf = 0xd3a0c0, read_event_handler = 0x454ee0 <ngx_http_test_reading>, write_event_handler = 0x4521f0 <ngx_http_terminate_handler>, cache = 0x0,
upstream = 0x0, upstream_states = 0x0, pool = 0x0, header_in = 0x66a7100, headers_in = {headers = {last = 0x66a6530, part = {elts = 0x10ebb50, nelts = 5, next = 0x0}, size = 48, nalloc = 20, pool = 0x66a6470}, host = 0x10ebb50, connection = 0x0,
if_modified_since = 0x0, if_unmodified_since = 0x0, if_match = 0x0, if_none_match = 0x0, user_agent = 0x10ebc10, referer = 0x0, content_length = 0x0, content_type = 0x0, range = 0x0, if_range = 0x0, transfer_encoding = 0x0, expect = 0x0, upgrade = 0x0,
accept_encoding = 0x10ebbb0, via = 0x0, authorization = 0x0, keep_alive = 0x0, x_forwarded_for = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, x_real_ip = 0x0, user = {len = 0, data = 0x0}, passwd = {len = 0, data = 0x0}, cookies = {elts = 0x66a71c0,
nelts = 0, size = 8, nalloc = 2, pool = 0x66a6470}, server = {len = 11, data = 0x10eb761 "r.mradx.net"}, content_length_n = -1, keep_alive_n = -1, connection_type = 1, chunked = 0, msie = 0, msie6 = 0, opera = 0, gecko = 0, chrome = 0, safari = 0, konqueror = 0},
headers_out = {headers = {last = 0x66a66a0, part = {elts = 0x66a6a38, nelts = 4, next = 0x0}, size = 48, nalloc = 20, pool = 0x66a6470}, status = 200, status_line = {len = 0, data = 0x0}, server = 0x0, date = 0x0, content_length = 0x0, content_encoding = 0x0,
location = 0x0, refresh = 0x0, last_modified = 0x0, content_range = 0x0, accept_ranges = 0x66a6ac8, www_authenticate = 0x0, expires = 0x66a6a68, etag = 0x66a6a38, override_charset = 0x0, content_type_len = 10, content_type = {len = 10,
data = 0xd84f60 "image/jpeg"}, charset = {len = 0, data = 0x0}, content_type_lowcase = 0x0, content_type_hash = 0, cache_control = {elts = 0x66a7468, nelts = 1, size = 8, nalloc = 1, pool = 0x66a6470}, content_length_n = 25036, date_time = 0,
last_modified_time = 1434536173}, request_body = 0x0, lingering_time = 0, start_sec = 1435303301, start_msec = 143, method = 2, http_version = 1001, request_line = {len = 0, data = 0x66a71d0 "GET /img/BA/1F3F84.jpg HTTP/1.1"}, uri = {len = 18,
data = 0x10eb78b "/img/BA/1F3F84.jpg"}, args = {len = 0, data = 0x0}, exten = {len = 3, data = 0x10eb79a "jpg"}, unparsed_uri = {len = 18, data = 0x10eb78b "/img/BA/1F3F84.jpg"}, method_name = {len = 3, data = 0x66a71d0 "GET /img/BA/1F3F84.jpg HTTP/1.1"},
http_protocol = {len = 8, data = 0x10eb7c1 "HTTP/1.1"}, out = 0x0, main = 0x66a64c0, parent = 0x0, postponed = 0x0, post_subrequest = 0x0, posted_requests = 0x0, phase_handler = 18, content_handler = 0, access_code = 0, variables = 0x66a6fa0, ncaptures = 0,
captures = 0x66a71f0, captures_data = 0x0, limit_rate = 0, limit_rate_after = 0, header_size = 386, request_length = 301, err_status = 0, http_connection = 0x5330770, spdy_stream = 0x66a7150, log_handler = 0x452510 <ngx_http_log_error_handler>, cleanup = 0x0,
subrequests = 201, count = 0, blocked = 0, aio = 0, http_state = 6, complex_uri = 0, quoted_uri = 0, plus_in_uri = 0, space_in_uri = 0, invalid_header = 0, add_uri_to_alias = 0, valid_location = 1, valid_unparsed_uri = 1, uri_changed = 0, uri_changes = 11,
request_body_in_single_buf = 0, request_body_in_file_only = 0, request_body_in_persistent_file = 0, request_body_in_clean_file = 0, request_body_file_group_access = 0, request_body_file_log_level = 5, request_body_no_buffering = 0, subrequest_in_memory = 0,
waited = 0, cached = 0, gzip_tested = 0, gzip_ok = 0, gzip_vary = 0, proxy = 0, bypass_cache = 0, no_cache = 0, limit_conn_set = 0, limit_req_set = 0, pipeline = 0, chunked = 0, header_only = 0, keepalive = 0, lingering_close = 0, discard_body = 0, reading_body = 0,
internal = 0, error_page = 0, filter_finalize = 0, post_action = 0, request_complete = 0, request_output = 1, header_sent = 1, expect_tested = 0, root_tested = 1, done = 0, logged = 0, buffered = 0, main_filter_need_in_memory = 1, filter_need_in_memory = 0,
filter_need_temporary = 0, allow_ranges = 1, single_range = 0, disable_not_modified = 0, stat_reading = 0, stat_writing = 1, state = 0, header_hash = 3194399592611459, lowcase_index = 18446744073709551615, lowcase_header = '\000' <repeats 31 times>,
header_name_start = 0x10eb81b "user-agent", header_name_end = 0x10eb825 "", header_start = 0x10eb829 "CFNetwork/711.3.18 Darwin/14.0.0", header_end = 0x10eb861 "", uri_start = 0x66a64c0 "HTTP", uri_end = 0x0, uri_ext = 0x10eb79a "jpg",
args_start = 0x0, request_start = 0x0, request_end = 0x0, method_end = 0x0, schema_start = 0x10eb7ac "https", schema_end = 0x10eb7b1 "", host_start = 0x0, host_end = 0x0, port_start = 0x0, port_end = 0x0, http_minor = 1, http_major = 1, content_start_sec = 0,
content_start_msec = 0, content_end_sec = 0, content_end_msec = 0, gzip_process = 0, gzip_start_sec = 0, gzip_start_msec = 0, gzip_end_sec = 0, gzip_end_msec = 0}
(gdb) p stream->request->connection
$11 = (ngx_connection_t *) 0x754ea20
(gdb) p *stream->request->connection
$12 = {data = 0x0, read = 0x754eaf8, write = 0x754eb58, fd = 1041, recv = 0x4424e0 <ngx_ssl_recv>, send = 0x441e90 <ngx_ssl_write>, recv_chain = 0x442990 <ngx_ssl_recv_chain>, send_chain = 0x484830 <ngx_http_spdy_send_chain>, listening = 0xcc6f00, sent = 16770,
log = 0x754ebb8, pool = 0x1edb9a0, sockaddr = 0x1edb9f0, socklen = 16, addr_text = {len = 11, data = 0x1edba50 "83.149.9.264"}, proxy_protocol_addr = {len = 0, data = 0x0}, ssl = 0x53307b8, local_sockaddr = 0xe773e0, local_socklen = 16, buffer = 0x0, queue = {
prev = 0x0, next = 0x0}, number = 68976568, requests = 7, buffered = 2, log_error = 2, unexpected_eof = 0, timedout = 0, error = 1, destroyed = 1, idle = 0, reusable = 0, close = 0, sendfile = 1, sndlowat = 1, tcp_nodelay = 2, tcp_nopush = 0, need_last_buf = 1}
(gdb) p stream->request->connection->write
$13 = (ngx_event_t *) 0x754eb58
(gdb) p *stream->request->connection->write
$14 = {data = 0x754ea20, write = 1, accept = 0, instance = 0, active = 0, disabled = 0, ready = 1, oneshot = 0, complete = 0, eof = 0, error = 0, timedout = 0, timer_set = 0, delayed = 0, deferred_accept = 0, pending_eof = 0, posted = 0, closed = 0, channel = 0,
resolver = 0, cancelable = 0, available = 0, handler = 0x47ed90 <ngx_http_spdy_close_stream_handler>, index = 0, log = 0x754ebb8, timer = {key = 0, left = 0x0, right = 0x0, parent = 0x0, color = 0 '\000', data = 0 '\000'}, queue = {prev = 0x0, next = 0x0}}
(gdb)

[ANN] OpenResty 1.7.10.2 released (no replies)

$
0
0
Hi folks!

I am pleased to announce the new formal release, 1.7.10.2, of the
OpenResty bundle:

https://openresty.org/#Download

We include a lot of fixes and new features accumulated in the last few months.

Special thanks go to all our contributors and users for making this happen!

Below is the complete change log for this release, as compared to the
last formal release (1.7.10.1):

* bugfix: ./configure: fixed the "--without-http_rewrite_module"
option by disabling the ngx_devel_kit (NDK) module automatically; also
automatically disable the the ngx_encrypted_session module when
the ngx_devel_kit (NDK) module is disabled.

* bugfix: ./configure: removed hacks to work around an old bug in
the ngx_lua module's build system (just recently fixed in
the ngx_lua module).

* bugfix: LuaJIT compilation might fail when old gcc 4 compilers
are used (like gcc 4.1.0). this regression had appeared in
OpenResty 1.7.7.2. thanks aseiot for the report.

* upgraded resty-cli to 0.03.

* bugfix: resty: command-line options did not pass to the user
Lua script unless "--" was intentionally specified. now
standalone Lua scripts with a shebang line work out of the
box (if LuaJIT is used, which is the default). thanks
neomantra for the report.

* bugfix: resty: now sends "error_log" to "stderr" instead of
the system-specific path "/dev/stderr". thanks Evan Wies for
the patch.

* doc: added the new section "Test Suite" as per Enrique
Garcia's request.

* tests: fixed test failures on Mac OS X. thanks Enrique
García for the report.

* upgraded the ngx_lua module to 0.9.16.

* feature: ngx.encode_base64(): added support for the
"no_padding" boolean argument to disable padding when a true
value is specified. thanks Shuxin Yang for the patch.

* feature: fixed compilation failures with nginx 1.9.0. thanks
Charles R. Portwood II for the original patch.

* feature: removed the dead code for the old "NGX_THREADS"
mode which breaks the new nginx (1.7.11+) with thread pool
support. thanks Tatsuhiko Kubo for the patch.

* bugfix: use of "ngx_http_image_filter_module" might lead to
request hang due to duplicate header filter invocations.
thanks Antony Dovgal for the report.

* bugfix: we should never automatically set "Content-Type" on
304 responses. thanks Simon Eskildsen for the patch.

* bugfix: raw downstream cosockets did not support
full-deplexing. thanks aviramc for the bug report and the
original patch.

* bugfix: we did not always discard the request body if the
user Lua handlers didn't, which might cause 400 error pages
for keep-alive or pipelined requests. thanks Shuxin Yang for
the original patch.

* bugfix: ngx.resp.get_headers(): some built-in headers were
not accessible via lowercase. thanks Nick Muerdter for the
patch.

* bugfix: we might still pick up Lua/LuaJIT headers/libraries
in the paths specified by nginx ./configure's
"--with-cc-opt=OPTS" and "--with-ld-opt=OPTS" optons even
when the LUAJIT_INC LUAJIT_LIB or LUA_INC LUA_LIB
environments are explicitly specified.

* bugfix: config: we might miss the linker option "-ldl" when
we shouldn't. this might lead to build failures.

* bugfix: access nonexistent fields in the "ngx" table in
init_by_lua* could lead to the exception "no request object
found" because of the overreacting "__index" metamethod of
the "ngx" table.

* bugfix: fixed compilation failures with very old versions of
PCRE, like 4.5.

* doc: fixed a bug in an example where both rewrite_by_lua and
content_by_lua produce response outputs. thanks fengidri for
the report.

* doc: fixed the context for the lua_need_request_body
directive. thanks Tatsuhiko Kubo for the patch.

* doc: fixed the code sample for ngx.redirect() to reflect
recent changes there. thanks Zi Lin for the report.

* doc: added a note on possible uninitialized variables for
short-circuited requests. thanks Simon Eskildsen for the
patch.

* tests: fixed nondeterminism due to unordered Lua table
iterations. thanks Markus Linnala for the patch.

* upgraded the ngx_headers_more module to 0.26.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* optimize: removed the unused C function
"ngx_http_headers_more_rm_header". thanks Markus Linnala for
the catch.

* doc: made it clear that more_set_headers always override
existing headers with the same name.

* upgraded the ngx_set_misc module to 0.29.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* tests: add openssl hmac defensive test. thanks Markus
Linnala for the patch.

* upgraded the ngx_lua_upstream module to 0.03.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* doc: README.md: fixed the get_backup_peers example. thanks
Jakub Kramarz for the patch.

* upgraded the ngx_srcache module to 0.30.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* upgraded the ngx_drizzle module to 0.1.9.

* feature: fixed compilation errors with nginx 1.9.1+.

* feature: automatic libdrizzle path discovery for Ubuntu
12.04. thanks Mathew Heard for the patch.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* upgraded the ngx_postgres module to 1.0rc6.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* bugfix: use "ngx_abs()" instead of "abs()" to fix one clang
warning ("-Wabsolute-value").

* upgraded the ngx_rds_csv module to 0.06.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* bugfix: fixed two clang "-Wconditional-uninitialized"
warnings.

* doc: improved the documentation a lot.

* upgraded the ngx_rds_json module to 0.14.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* doc: improved the documentation a lot.

* upgraded the ngx_echo module to 0.58.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* bugfix: we no longer break on subrequests when the
"ngx_http_ssi_module" is diasbled. thanks Anthony Ryan for
the patch.

* bugfix: use of "ngx_http_image_filter_module" might lead to
request hang due to duplicate header filter invocations.

* upgraded the ngx_memc module to 0.16.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* bugfix: fixed clang warnings on "unused variables" in the
Ragel generated source.

* upgraded the ngx_redis2 module to 0.12.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* bugfix: fixed clang warnings on "unused variables" in the
Ragel generated source.

* bugfix: always set the response status code in case of bad
statuses like 504. thanks Kaito Sys for the report.

* doc: typo fixes from Karan Chaudhary.

* upgraded the ngx_encrypted_session module to 0.04.

* feature: added debugging logs for expiration times during
encryption and decription. also adjusted other debug logging
messages a bit. thanks Kalpesh Patel for requesting this.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* bugfix: fixed warnings from the Microsoft C/C++ compiler.
thanks Edwin Cleton for the report.

* doc: improved the documentation a lot.

* upgraded the ngx_iconv module to 0.11.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* upgraded the ngx_array_var module to 0.04.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* doc: improved the documentation a lot.

* upgraded the ngx_xss module to 0.05.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* bugfix: fixed clang warnings on "unused variables" in the
Ragel generated source.

* doc: improved the documentation a lot.

* upgraded the ngx_form_input module to 0.11.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* upgraded the ngx_coolkit module to 0.2rc3.

* feature: fixed compilation failures with nginx 1.7.11+
configured with "--with-threads".

* upgraded LuaJIT to v2.1-20150622:
https://github.com/openresty/luajit2/tags

* imported Mike Pall's latest changes:

* Add Xbox One port.

* Fix narrowing of TOBIT.

* x64: Allow building without external unwinder.

* x86/x64: Fix argument check for bit shifts.

* x64: Add LJ_GC64 mode interpreter. Enable this mode
with: make "XCFLAGS=-DLUAJIT_ENABLE_GC64"

* Disable trace stitching (for now) due to a design
mistake.

* Fix stack check in narrowing optimization.

* ARM64: Fix math.floor/math.ceil for string args.

* DynASM/PPC: Add sub/shift/rotate/clear instruction
aliases.

* DynASM/PPC: Add support for parameterized shifts/masks.

* PPC: Fix cross-endian builds.

* PPC: Fix write barrier in BC_TSETR.

* Fix Lua/C API typecheck error for special indexes.

* FFI: Fix FOLD rule for TOBIT + CONV num.u32.

* ARM: Handle more arch defines.

* Properly fail unsupported cross-compile to MIPS64.

The HTML version of the change log with lots of helpful hyper-links
can be browsed here:

http://openresty.org/#ChangeLog1007010

The next formal release of OpenResty will be based on the new Nginx 1.9.x core.

OpenResty (aka. ngx_openresty) is a full-fledged web application
server by bundling the standard Nginx core, Lua/LuaJIT, lots of 3rd-party Nginx
modules and Lua libraries, as well as most of their external
dependencies. See OpenResty's homepage for details:

http://openresty.org/

We have run extensive testing on our Amazon EC2 test cluster and
ensured that all the components (including the Nginx core) play well
together. The latest test report can always be found here:

http://qa.openresty.org

Have fun!

Best regards,
-agentzh

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Nginx doesn't redirect www no m in Safari, iPhone, iPad (4 replies)

$
0
0
The problem is, the site is entered with www in url in a mobile device with parameters in the url, it is redirected from www.domain.com to m.domain.com but the parameters entered with www.domain.com/parameters when redirected to m.domain.com doesn't receive the parameters from thr url origin in www.

In conclusion www.domain.com/parameters should redirect to m.domain.com/parameters but is redirected to m.domain.com, the parameters are clean. Is there a way no to clean it ?


The www config is the following :

server {
listen 80;
server_name www.domain.com;
...

#to detect if the device with www entered in domain is mobile
if ($http_user_agent ~* '(iPhone|iPod|iPad|Android|BlackBerry|webOS|Windows Phone)') {
rewrite ^ http://m.domain.com$uri;
}


}

The mobile configuration is
server {
listen 80;
server_name m.domain.com;

...
}

DNS cache in nginx (no replies)

$
0
0
Hello ,

I have an A record which resolve to 2 CNAME's , the DNS failover will
make the switch if something go wrong .

The problem is that after a change the nginx stick to the OLD IP
unless I reload it ..
any way the Caching can be disabled ?
I tried the following with no success :
add valid for the resolver ,
resolver 8.8.8.8 valid=5s;
and or
resolver_timeout 1s;

Any recommendation to solve it ?

-- shay

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

rewrite URL (1 reply)

$
0
0
Hello,

I try to use Nginx as a proxy (for SSL) on a Jetty server. The Jetty application should be accessed by a subdirectory of my Nginx. I have setup this location configuration:

location /myapp {

proxy_pass http://localhost:8112;

proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
#proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 650M;

}

The Jetty server runs under http://localhost:8112, if I change the „location /myapp“ to „location /„ everything works fine. The Jetty server returns URLs with the base URL /, so on this configuration CSS / JSS files are not found.
How can I rewrite the URLs, so that all files are found within the directory /myapp ?

Thanks

Phil
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

[ANN] Nginx-Clojure v0.4.0 Release! (no replies)

$
0
0
0.4.0 (2015-07-06)

New Feature: Server Side Websocket (issue #73)
New Feature: A build-in Jersey container to support java standard RESTful web services (JAX-RS 2.0) (issue #74)
New Feature: Tomcat 8 embedding support (so servlet 3.1/jsp/sendfile/JSR-356 websocket work within nginx!) (issue #67)
New Feature: Coroutined Based Client Socket Supports to Bind to Specified IP Address (issue #69)
New Feature: Handler's Property Configuration (issue #66)
Enhancement: NginxHttpServerChannel can work with Rewrite Handler or Access Handler (issue #79)
Enhancement: Configurable Write Buffer Size for SSE or Websocket (issue #76)
Bug Fix: When we do not configure jvm_path proxy_pass will not work (issue #72)
Bug Fix: nginx worker restart when get the value of header X-Forwarded-For (issue #70)
Bug Fix: proxy_cache_path causes crash (issue #64)
Bug Fix: send_timeout does not take effect with NginxHttpServerChannel (issue #78)
Bug Fix: Waving tool generates wrong wave information of fuzzing classes (issue #80)
Documents : Release History link in README (issue #68)
Binaries Distribution: built with The latest stable Nginx v1.8.0 which released at 2015-04-21.

Binaries of Releases (for linux, windows and macosx) http://sourceforge.net/projects/nginx-clojure/files/.
Freebsd users can get old v0.3.0 from https://www.freshports.org/www/nginx .
Sources of Releases https://github.com/nginx-clojure/nginx-clojure/releases
website : http://nginx-clojure.github.io/

Debian Packages from nginx.org (1 reply)

$
0
0
Hey Guys,

the Debian package for latest stable nginx contains a logrotate.d file with following contents:
"create 640 nginx adm“

However, the package does not create a user „debian“ and the user does not exist in Debian by default.
Id say this is a bug - however Im not able to login to TRAC, I rather get a „502“ or a message telling me that google does not support OpenID2.0.

How do you handle this issue, I think im not the only one running into it?

Cheers,
Sebastian

--
Sebastian Stabbert
Systemadministrator

Host Europe GmbH is a company of HEG

E-Mail: sebastian.stabbert@heg.com
Telefon: +49 2203 1045-7362

-----------------------------------------------------------------------
Host Europe GmbH - http://www.hosteurope.de
Welserstraße 14 - 51149 Köln - Germany
HRB 28495 Amtsgericht Köln
Geschäftsführer: Dr. Claus Boyens, Tobias Mohr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

stub_status newrelic plugin (no replies)

$
0
0
Hello nginx experts,

I wonder how nginx generate the server status by stub_status directive.
I have set several virtual host on single server and I put the several nginx server behind load balancer.

I have 2 questions:
1. does stub_status show difference results between virtual hosts in one server or actually this status report is for whole server, regardless its virtual host?

2. what if I put several server behind load balancer, is it still relevant to single server (shown randomly depend on load balancer) or they can be separated per server? Currently I am using newrelic plugin and the report seems separated, I am not pretty sure if this report is accurate to the respective server or it is just random report based on stub_status accessed by the agent.

thank you for your time and answer.

proxy_cache_key with variables (2 replies)

$
0
0
I've just created a configuration composed of two servers.
Both just forwards traffic from different ports (and protocols) to different servers, and keep responses in cache. It works nice.

For both servers "GET /" request is sent, in the response there is proper resource. Thus (to distinguish responses in the cache) I added for both cache_key:

proxy_cache_key "$upstream_addr*$request";

But it doesn't work. I found that upstream states are not available and thus "proxied" address is not known when cache key is computed. And "proxied" address is computed only when additional stream must be used..

Is there any way to get proper key? Or any other way to keep all copies in the cache?

I plan to add "load balancing" module, which would be able to forward request on (multiple) source addresses to multiple proxied addresses, with caching.. Will it work properly?

Multiple add_header (2 replies)

$
0
0
Hello,

I'm using PHP with nginx 1.9.2 and it works great!
But there's something I don't understand with the add_header directive.

I use add_header in server and location block, but it seems only the one in location is used.
If I remove the add_header in the location block, I get the header I added in the server block.

Here's a short example:
server {
add_header Strict-Transport-Security "max-age=604800; includeSubDomains";

location = /blah {
add_header X-Test test;
}
}

If I access /blah, I'll only get the X-Test header, while I'd like to get X-Test and Strict-Transport-Security.
If I comment the add_header in the blah location and access /blah, I'll get the Strict-Transport-Security header.

How can I solve this problem, without having to duplicate/include "add_header Strict-Transport-Security" everywhere?

Seems http://stackoverflow.com/a/19135714 is the same problem.

Best Regards

leaking memory nginx 1.8.0 (11 replies)

$
0
0
Hello, need help with leaking memory
i installed fresh system , centos7.1 +directadmin + nginx1.8.0 + mariadb5.5.41 + php54 & php56 both with php_fpm
the server it for webhosting and i have there 32gb for now have only 4 website on it, and after 1-2hours nginx take all memory when it come to 96% it stop there and then all websites fall but nginx not, only after i reset nginx all back to normal for 1-2hours again.

how can i debug where the problem? or try find the problem? seems in logs i not see anything

RE: Nginx SFTP/FTP loadbalancer (1 reply)

$
0
0
Dears,
This is Felix which is from Lenovo.I need your kindly help of nginx.
Here is one question of nginx SFTP/FTP loadbalancer.
The backend is two machines 10.96.144.195/10.96.144.196 service IP is 10.96..144.197 which have some http,https,SFTP and FTP service.
The frontend systems send some data to 10.96.144.195/10.96.144.196 by 10.96..144.197.
Now we want to use nginx to do the loadbalancer which dispatch the http,https,SFTP and FTP to 10.96.144.195/10.96.144.196 not by 10.96.144.197.
I could configure the nginx.conf to loadbalancer the http and https service..
But how to loadbalancer SFTP and FTP service?
Could you give me one configuration example for SFTP and FTP service?
BR
Felix zhang

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

fastcgi retry upstream (transparent php-fpm restart)? (no replies)

$
0
0
Hi,

I'm using nginx with 1 php-fpm (via unix socket), and i'm wondering if
there is a way to make nginx retry on error, something like
fastcgi_next_upstream but for the same upstream.

I would like to be able to transparently restart php-fpm and not send some
502 to the clients

So, is there a way to make nginx retry the same upstream for X seconds (or
retry every Y seconds for max Z attempts or ...) (on errors like "connect()
failed (111: Connection refused) while connecting to upstream") ?

I'm open to any tricks

Thanks in advance
Etienne

p.s: I already know about atomic/transparent php deployment with
"$realpath_root" and multiple docroot (
https://github.com/zendtech/ZendOptimizerPlus/issues/126#issuecomment-24020445
)
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

*_cache_revalidate directives (no replies)

$
0
0
Hello,

From the documentation, I don't understand how the fastcgi_cache_revalidate (or scgi_cache_revalidate or proxy_cache_revalidate or uwsgi_cache_revalidate) works.
Please, can someone explain what nginx does when cache is enabled and the revalidate directive is set to "on"?

Best Regards

Do not log "directory index of /foo/bar/ is forbidden" (no replies)

$
0
0
Hello,

I have found "conditional logging" in
http://nginx.org/en/docs/http/ngx_http_log_module.html
It seems that it only works on status codes.

Is there a way to disable logging for something like:

2015/07/09 11:02:30 [error] 24928#0: *97983 directory index of
"/foo/bar/" is forbidden, client: xx.xxx.xx.xx, server: www.example.com,
request: "GET / HTTP/1.1", host: "www.example.com"

nginx version: nginx/1.9.1

Best Regards,
basti

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Wrong mimetype when served from nginx (no replies)

$
0
0
Hello,

I have a small issue with my nginx (1.2.1) configuration:
some files are served as "application/octet-stream" while they are
detected as "text/plain" by "mimetype <file>" command.

File names are just "1", "2", and so on.

Is there a way to enforce mimetype for those files?

I thought about something like this:

location ~ /path/to/file/[0-9]+ {
types {}
default_type text/plain;
}

but after that, I get a 404 — what did I wrong?

Thanks for your support!

Cheers,

C.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

try_files setup (no replies)

$
0
0
Hello,

I'm quite new to the advanced nginx configuration so I will need your
help. :)

I'm currently working on a nginx + php5-fpm (chrooted) + wordpress setup.
My basic setup works fine but I wanted to improve the try_files section.

My main concern is to correctly take in charge URIs by nginx or php5-fpm
depending on their types and existence.

My current setup for wordpress with nice permalinks
(http://host/wordpress_page/) :

location / {
root /content/chroot/htdocs;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
include fastcgi_params;
root /htdocs;
fastcgi_pass 127.0.0.1:1234;
fastcgi_param SCRIPT_FILENAME $document_root$request_filename;
}

error_page 404 /404.html;
#location = /404.html {
# root /usr/share/nginx/html;
#}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

The main problem is that if I try to get a non existing php file
(http://host/nonexisting.php) I get always "No input file specified."
fpm error.
I'd like to redirect here to a 404 error page instead.

In case I call a different non existing file (nonexisting.jpg) I get an
error displayed from Wordpress saying this page does not exist. I
suppose this is correct in a wordpress setup because of the permalinks
setup I described above.

Any help will be appreciate. :)

--

Best regards,
Artur.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Lost connection after reading 2147479552 bytes with sendfile (no replies)

$
0
0
Hi!

I've bumped into a strange problem lately, and though I've found a
workaround I thought I'd post here to try and understand what the
underlying issue can be in case it affects anyone else.


The short version is:
Running Nginx 1.9.2 on Scientific Linux 6 with a
2.6.32-504.8.1.el6.x86_64 kernel, nginx is configured to serve a large
file (4GB) with sendfile enabled, the file download hangs exactly after
2147479552 bytes, after ~ 60s the connection is dropped (presumably
because of the default send_timeout).

Setting sendfile_max_chunk to 1G fixes the problem


Longer version:

# Create a random 4G file:
mkdir /tmp/test
dd if=/dev/urandom of=/tmp/test/bigfile bs=1M count=4096

# Basic NGINX configuration /tmp/nginx.conf:
worker_processes 1;
daemon off;

events {
worker_connections 768;
}

http {
sendfile on;

access_log /tmp/access.log;
error_log /tmp/error.log debug;

server {
listen 8080 default_server;
location / {
root /tmp/test/;
}
}
}

# Nginx 1.9.2 was compiled by hand:
nginx -V
nginx version: nginx/1.9.2
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/tmp/opt --conf-path=/etc/nginx/nginx.conf --error-log-path=/tmp/error.log --http-log-path=/tmp/access.log --pid-path=/tmp/nginx.pid --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --without-pcre --without-http_rewrite_module --with-debug


# Run nginx with the above configuration (non-root user, hence all the
# /tmp/ stuff above)
nginx -c /tmp/nginx.conf


# On the same machine run a wget (auto-retry disabled):
$ wget http://localhost:8080/bigfile -O /dev/null -t 1
--2015-07-10 17:02:22-- http://localhost:8080/bigfile
Resolving localhost... 127.0.0.1, ::1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4294967296 (4.0G) [text/plain]
Saving to: “/dev/null”

49% [===================================================================================> ] 2,147,479,552 --.-K/s in 96s

2015-07-10 17:03:58 (21.4 MB/s) - Connection closed at byte 2147479552. Giving up.

# The error logs is visible at:
# https://gist.githubusercontent.com/mathiasuk/9022d3458ef373db1775/raw/e483a69aae10805558fefc4eefb381e34bbbeaf9/error-sc6.5.log




I tried the same thing on an Ubuntu 14.04.2 without problem, however, in
this case the sendfile system call always reads much fewer bytes at a
time https://gist.githubusercontent.com/mathiasuk/018e0462d8788288d0d3/raw/error-ubuntu-14.04.02.log :

$ grep sendfile /tmp/error-ubuntu-14.04.02.log|head
2015/07/10 17:08:51 [debug] 15680#0: *1 sendfile: @0 2147479552
2015/07/10 17:08:51 [debug] 15680#0: *1 sendfile: 3557719 of 2147479552 @0
2015/07/10 17:08:51 [debug] 15680#0: *1 sendfile: @3557719 2147481257
2015/07/10 17:08:51 [debug] 15680#0: *1 sendfile: 7792477 of 2147481257 @3557719
2015/07/10 17:08:51 [debug] 15680#0: *1 sendfile: @11350196 2147483468
2015/07/10 17:08:51 [debug] 15680#0: *1 sendfile: 1833524 of 2147483468 @11350196
2015/07/10 17:08:51 [debug] 15680#0: *1 sendfile: @13183720 2147480856
2015/07/10 17:08:51 [debug] 15680#0: *1 sendfile: 1899007 of 2147480856 @13183720
2015/07/10 17:08:51 [debug] 15680#0: *1 sendfile: @15082727 2147482393
2015/07/10 17:08:51 [debug] 15680#0: *1 sendfile: 1964490 of 2147482393 @15082727


Whereas on the SL6 box sendfile tries to read 2147479552 in one go and
nginx then seems to stop there:

$ grep sendfile /tmp/error-sc6.5.log
2015/07/10 17:02:22 [debug] 22749#0: *1 sendfile: @0 2147479552
2015/07/10 17:02:22 [debug] 22749#0: *1 sendfile: 2147479552 of 2147479552 @0


I'm not sure if this is the right place to post this, please point me in
the right direction if not :)

Let me know if I can provide more information or details.

Cheers,
Mathias

--
* Mathias Andre Web & Advanced Projects Coordinator
*E S* European Southern Observatory ESO Education & Public Outreach Department
O Karl Schwarzschildstr. 2
* D-85748 Garching Phone : +49 (0)89 3200 6760
Germany Office 246
"For every problem, there is a solution that is simple, neat, and wrong."
H. L. Mencken

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Problem with devise and nginx proxy cache (no replies)

$
0
0
Hi.
I have a RoR project which was working just fine.
But i've tryied to follow this site and add proxy cache to my nginx config: http://vstark.net/2012/10/21/nginx-unicorn-performance-tweaks/ and devise just won't sign_in anymore. I don't get any errors, just don't sign_in and redirect me to login again.

As the autor from the link suggested to someone with same problem as I, i've done this on my nginx conf:

location = /users/sign_in{
proxy_pass http://app;
proxy_set_header Host $http_host;
proxy_ignore_headers Set-Cookie;
proxy_ignore_headers Cache-Control;
proxy_cache_bypass $http_secret_header;
add_header X-Cache-Status $upstream_cache_status;
}

The same to /login.
But devise still won't sign_in.

Anyone knows how to solve that?
Any more configs so I can skip cache to sign_in?
Viewing all 7229 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>