summaryrefslogtreecommitdiffhomepage
path: root/auto (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-04-05Configure: fixed --test-build-epoll on FreeBSD 13.Maxim Dounin2-23/+25
In FreeBSD 13, eventfd(2) was added, and this breaks build with --test-build-epoll and without --with-file-aio. Fix is to move eventfd(2) detection to auto/os/linux, as it is used only on Linux as a notification mechanism for epoll().
2021-03-05Mail: realip module.Maxim Dounin1-0/+6
When configured with the "set_real_ip_from", it can set client's IP address as visible in logs to the one obtained via the PROXY protocol.
2021-03-01Introduced strerrordesc_np() support.Maxim Dounin1-6/+22
The strerrordesc_np() function, introduced in glibc 2.32, provides an async-signal-safe way to obtain error messages. This makes it possible to avoid copying error messages.
2021-03-01Improved maximum errno detection.Maxim Dounin1-28/+0
Previously, systems without sys_nerr (or _sys_nerr) were handled with an assumption that errors start at 0 and continuous. This is, however, not something POSIX requires, and not true on some platforms. Notably, on Linux, where sys_nerr is no longer available for newly linked binaries starting with glibc 2.32, there are gaps in error list, which used to stop us from properly detecting maximum errno. Further, on GNU/Hurd errors start at 0x40000001. With this change, maximum errno detection is moved to the runtime code, now able to ignore gaps, and also detects the first error if needed. This fixes observed "Unknown error" messages as seen on Linux with glibc 2.32 and on GNU/Hurd.
2021-02-20Configure: marked top-level make targets as phony.Ruslan Ermilov2-0/+4
Reported by Thibault Nélis.
2020-11-19Core: "-e" command line option.Igor Ippolitov1-0/+4
When installing or running from a non-root user it is sometimes required to override default, compiled in error log path. There was no way to do this without rebuilding the binary (ticket #147). This patch introduced "-e" command line option which allows one to override compiled in error log path.
2020-11-10Configure: shared sources for addon modules.Maxim Dounin3-3/+45
Addon modules, both dynamic and static, can now use shared source files. Shared sources result in only one make rule even if specified several times in different modules.
2020-11-10Configure: initialization of NGX_ADDON_SRCS.Maxim Dounin1-0/+1
2020-11-10Configure: style.Maxim Dounin1-5/+5
2020-08-28Stream: set module.Pavel Pautov2-0/+13
Adds 'set' directive to the stream server context.
2019-10-17Events: available bytes calculation via ioctl(FIONREAD).Maxim Dounin1-0/+12
This makes it possible to avoid looping for a long time while working with a fast enough peer when data are added to the socket buffer faster than we are able to read and process them (ticket #1431). This is basically what we already do on FreeBSD with kqueue, where information about the number of bytes in the socket buffer is returned by the kevent() call. With other event methods rev->available is now set to -1 when the socket is ready for reading. Later in ngx_recv() and ngx_recv_chain(), if full buffer is received, real number of bytes in the socket buffer is retrieved using ioctl(FIONREAD). Reading more than this number of bytes ensures that even with edge-triggered event methods the event will be triggered again, so it is safe to stop processing of the socket and switch to other connections. Using ioctl(FIONREAD) only after reading a full buffer is an optimization. With this approach we only call ioctl(FIONREAD) when there are at least two recv()/readv() calls.
2019-05-08Unconditional compilation of the postpone filter.Roman Arutyunyan2-18/+2
Postpone filter is an essential part of subrequest functionality. In absence of it a subrequest response body is sent to the client out of order with respect to the main request header and body, as well as other subrequests. For in-memory subrequests the response is also sent to the client instead of being stored in memory. Currently the postpone filter is automatically enabled if one of the following standard modules which are known to create subrequests is enabled: ssi, slice, addition. However a third-party module that creates subrequests can still be built without the postpone filter or be dynamically loaded in nginx built without it.
2019-04-04Win32: defined pdb path.Maxim Dounin1-1/+1
By default, MSVC uses vc<version>.pdb in the current directory. With the "-Fd" switch it is directed to be in the objs directory instead.
2019-01-30Configure: added explicit ngx_binext to the linker output argument.Sergey Kandaurov1-1/+1
Unlike with GCC or MSVC, Clang linker doesn't auto-append ".exe" to the name of the output binary when building on win32.
2019-01-24Win32: enabled both select and poll on Windows by default.Maxim Dounin1-7/+1
Since we now have both select and poll on Windows, it is enough to do not set EVENT_FOUND, auto/modules will enable both automatically.
2019-01-24Win32: added WSAPoll() support.Maxim Dounin2-0/+2
WSAPoll() is only available with Windows Vista and newer (and only available during compilation if _WIN32_WINNT >= 0x0600). To make sure the code works with Windows XP, we do not redefine _WIN32_WINNT, but instead load WSAPoll() dynamically if it is not available during compilation. Also, sockets are not guaranteed to be small integers on Windows. So an index array is used instead of NGX_USE_FD_EVENT to map events to connections.
2019-01-24Win32: properly enabled select on Windows.Maxim Dounin1-0/+1
Previously, select was compiled in by default, but the NGX_HAVE_SELECT macro was not set, resulting in iocp being used by default unless the "--with-select_module" configure option was explicitly specified. Since the iocp module is not finished and does not work properly, this effectively meant that the "--with-select_module" option was mandatory. With the change NGX_HAVE_SELECT is properly set, making "--with-select_module" optional. Accordingly, it is removed from misc/GNUmakefile win32 target.
2018-07-24Configure: fixed compiler warnings with "-Wall -Wextra".Sergey Kandaurov4-5/+10
2018-06-15Upstream: ngx_http_upstream_random module.Vladimir Homutov2-0/+31
The module implements random load-balancing algorithm with optional second choice. In the latter case, the best of two servers is chosen, accounting number of connections and server weight. Example: upstream u { random [two [least_conn]]; server 127.0.0.1:8080; server 127.0.0.1:8081; server 127.0.0.1:8082; server 127.0.0.1:8083; }
2018-06-01Events: moved ngx_recvmsg() to new file src/event/ngx_event_udp.c.Roman Arutyunyan1-0/+1
2018-04-24Configure: fixed clang version detection (closes #1539).Ruslan Ermilov1-1/+2
While 325b3042edd6 fixed it on MINIX, it broke it on systems that output the word "version" on several lines with "cc -v". The fix is to only consider "clang version" or "LLVM version" as clang version, but this time only using sed(1).
2018-03-22Configure: restored "no-threads" in OpenSSL builds.Maxim Dounin1-1/+1
This was previously used, but was incorrectly removed in 83d54192e97b while removing old threads remnants. Instead of using it conditionally when threads are not used, we now set in unconditionally, as even with thread pools enabled we never call OpenSSL functions in threads. This fixes resulting binary when using --with-openssl with OpenSSL 1.1.0+ and without -lpthread linked (notably on FreeBSD without PCRE).
2018-03-22Configure: fixed static compilation with OpenSSL 1.1.1.Maxim Dounin3-7/+16
OpenSSL now uses pthread_atfork(), and this requires -lpthread on Linux to compile. Introduced NGX_LIBPTHREAD to add it as appropriate, similar to existing NGX_LIBDL.
2018-03-19Configure: added gRPC module help message.Sergey Kandaurov1-0/+1
2018-03-17The gRPC proxy module.Maxim Dounin2-0/+13
The module allows passing requests to upstream gRPC servers. The module is built by default as long as HTTP/2 support is compiled in. Example configuration: grpc_pass 127.0.0.1:9000; Alternatively, the "grpc://" scheme can be used: grpc_pass grpc://127.0.0.1:9000; Keepalive support is available via the upstream keepalive module. Note that keepalive connections won't currently work with grpc-go as it fails to handle SETTINGS_HEADER_TABLE_SIZE. To use with SSL: grpc_pass grpcs://127.0.0.1:9000; SSL connections use ALPN "h2" when available. At least grpc-go works fine without ALPN, so if ALPN is not available we just establish a connection without it. Tested with grpc-c++ and grpc-go.
2018-03-17HTTP/2: externalized various constants and interfaces.Maxim Dounin1-0/+1
2018-03-01Core: ngx_current_msec now uses monotonic time if available.Maxim Dounin1-0/+24
When clock_gettime(CLOCK_MONOTONIC) (or faster variants, _FAST on FreeBSD, and _COARSE on Linux) is available, we now use it for ngx_current_msec. This should improve handling of timers if system time changes (ticket #189).
2018-02-15HTTP/2: push additional request headers (closes #1478).Ruslan Ermilov1-0/+1
The Accept-Encoding, Accept-Language, and User-Agent header fields are now copied from the original request to pushed requests.
2017-12-19Fixed capabilities version.Roman Arutyunyan1-1/+1
Previously, capset(2) was called with the 64-bit capabilities version _LINUX_CAPABILITY_VERSION_3. With this version Linux kernel expected two copies of struct __user_cap_data_struct, while only one was submitted. As a result, random stack memory was accessed and random capabilities were requested by the worker. This sometimes caused capset() errors. Now the 32-bit version _LINUX_CAPABILITY_VERSION_1 is used instead. This is OK since CAP_NET_RAW is a 32-bit capability (CAP_NET_RAW = 13).
2017-12-18Improved the capabilities feature detection.Roman Arutyunyan1-2/+3
Previously included file sys/capability.h mentioned in capset(2) man page, belongs to the libcap-dev package, which may not be installed on some Linux systems when compiling nginx. This prevented the capabilities feature from being detected and compiled on that systems. Now linux/capability.h system header is included instead. Since capset() declaration is located in sys/capability.h, now capset() syscall is defined explicitly in code using the SYS_capset constant, similarly to other Linux-specific features in nginx.
2017-12-13Retain CAP_NET_RAW capability for transparent proxying.Roman Arutyunyan1-0/+31
The capability is retained automatically in unprivileged worker processes after changing UID if transparent proxying is enabled at least once in nginx configuration. The feature is only available in Linux.
2017-12-11Use sysconf to determine cacheline size at runtime.Debayan Ghosh1-0/+10
Determine cacheline size at runtime if supported using sysconf(_SC_LEVEL1_DCACHE_LINESIZE). In case not supported, fallback to compile time defaults.
2017-12-11Configure: set default cacheline size to 64 for aarch64 platforms.Debayan Ghosh1-0/+5
2017-12-07Configure: fixed SO_BINDANY comment.Maxim Dounin1-1/+1
2017-12-07Configure: moved IP_BIND_ADDRESS_NO_PORT test.Maxim Dounin1-11/+11
In 2c7b488a61fb, IP_BIND_ADDRESS_NO_PORT test was accidentally placed between SO_BINDANY, IP_TRANSPARENT, and IP_BINDANY tests. Moved it after these tests.
2017-11-23Configure: fixed clang detection on MINIX.Maxim Dounin2-2/+6
As per POSIX, basic regular expressions have no alternations, and the interpretation of the "\|" construct is undefined. At least on MINIX and Solaris grep interprets "\|" as literal "|", and not as an alternation as GNU grep does. Removed such constructs introduced in f1daa0356a1d. This fixes clang detection on MINIX.
2017-07-20Mirror module.Roman Arutyunyan2-0/+14
2017-07-20Precontent phase.Roman Arutyunyan1-0/+11
The phase is added instead of the try_files phase. Unlike the old phase, the new one supports registering multiple handlers. The try_files implementation is moved to a separate ngx_http_try_files_module, which now registers a precontent phase handler.
2017-07-19Configure: fixed PCRE requirement check by ngx_http_rewrite_module.Samuel Martin1-1/+1
The http_rewrite module cannot be selected when http is disabled. Fixed the PCRE check condition to avoid irrelevant check failure. This is a regression from 4d874b4d82ed. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
2017-06-06Configure: use .exe for binaries for all win32 compilers.Orgad Shaneh4-3/+1
2017-06-06Configure: fix compilation on MSYS2 / MinGW64.Orgad Shaneh1-1/+1
2017-06-02Configure: enabled rpath for NetBSD.Sergey Kandaurov1-0/+8
2017-06-01Configure: disabled IP_PKTINFO feature on certain platforms.Roman Arutyunyan1-1/+4
On Cygwin and NetBSD 7.0+ struct in_pktinfo has no ipi_spec_dst field, which caused nginx compilation error. Now presence of this field is ensured by the IP_PKTINFO feature test. The problem was introduced by dbb0c854e308 (1.13.0).
2017-05-29Configure: sched_setaffinity() test moved to auto/unix.Maxim Dounin2-14/+12
The sched_setaffinity() function was introduced in DragonFly BSD 4.7, so it is no longer Linux-specific. Prodded by Sepherosa Ziehau.
2017-05-15Configure: recent Sun C versions.Maxim Dounin1-1/+4
2017-05-15Configure: disabled gcc atomics with Sun C (ticket #1261).Maxim Dounin1-15/+19
Oracle Developer Studio 12.5 introduced GCC-compatible __sync builtins. Unfortunately, these builtins are neither GCC-compatible (they generate warnings when used with volatile), nor working (unexpectedly fail on unpredictable combinations of code layout and compiler flags). As such, the gcc builtin atomic operations configure test explicitly disabled when compiling with Sun C.
2017-05-15Configure: style.Maxim Dounin1-1/+1
2017-04-11Set UDP datagram source address (ticket #1239).Roman Arutyunyan1-0/+13
Previously, the source IP address of a response UDP datagram could differ from the original datagram destination address. This could happen if the server UDP socket is bound to a wildcard address and the network interface chosen to output the response packet has a different default address than the destination address of the original packet. For example, if two addresses from the same network are configured on an interface. Now source address is set explicitly if a response is sent for a server UDP socket bound to a wildcard address.
2017-04-17Enabled IPV6_RECVPKTINFO / IPV6_PKTINFO on macOS.Sergey Kandaurov1-1/+3
This change allows setting the destination IPv6 address of a UDP datagram received on a wildcard socket.
2017-03-16Configure: fixed --without_http.Ruslan Ermilov2-691/+675
Instead of turning off some randomly selected http modules when --without-http is specified, just don't process the whole http modules section.