活动介绍

ngx_http_sub_module

时间: 2025-08-21 09:54:24 浏览: 4
### 功能 `ngx_http_sub_module` 是 Nginx 提供的一个过滤器模块,可以用于修改网站响应内容中的字符串,例如替换网页中的某些文本内容。这个模块支持在 `http`、`server` 和 `location` 上下文中使用,并且主要通过 `sub_filter` 指令来实现字符串替换功能。它可以用于过滤敏感词、修改页面中的链接或资源路径等场景[^2]。 然而,`ngx_http_sub_module` 的一个限制是它不支持正则表达式替换,而第三方模块 `ngx_http_substitutions_filter_module` 则弥补了这一不足,允许使用正则表达式进行更灵活的替换操作。 ### 配置与安装 在使用 `ngx_http_sub_module` 之前,需要确认 Nginx 是否已经编译并启用了该模块。可以通过运行 `nginx -V` 命令来查看当前 Nginx 的编译参数。如果输出中包含 `--with-http_sub_module`,则表示该模块已被启用[^1]。 如果模块未启用,则需要重新编译 Nginx,并在编译参数中添加 `--with-http_sub_module`,以启用该模块的支持。 ### 使用方法 #### 1. 基本使用 `ngx_http_sub_module` 主要通过以下指令进行配置: - `sub_filter <search_string> <replace_string>`:定义需要替换的字符串。 - `sub_filter_once <on|off>`:控制是否只替换第一个匹配项(`on`)或替换所有匹配项(`off`)。 - `sub_filter_types <mime_types>`:指定哪些 MIME 类型的内容需要进行替换,默认只替换 `text/html` 类型。 - `sub_filter_last_modified <on|off>`:控制是否允许修改响应头中的 `Last-Modified` 字段。 以下是一个基本的配置示例,将页面中所有的 `http://127.0.0.1:8080` 替换为 `https://$host`: ```nginx location / { sub_filter 'http://127.0.0.1:8080' 'https://$host'; sub_filter_once on; } ``` #### 2. 多次替换 如果需要替换多个不同的字符串,可以在同一个 `location` 块中多次使用 `sub_filter` 指令。例如,同时替换链接和图片路径: ```nginx location / { sub_filter '<a href="http://127.0.0.1:8080/' '<a href="https://$host/'; sub_filter '<img src="http://127.0.0.1:8080/' '<img src="https://$host/'; sub_filter_once on; } ``` #### 3. 替换非 HTML 内容 默认情况下,`sub_filter` 仅对 `text/html` 类型的响应内容生效。如果希望对其他 MIME 类型(如 `text/plain` 或 `application/xml`)也进行替换,可以使用 `sub_filter_types` 指令指定: ```nginx location / { sub_filter 'old_string' 'new_string'; sub_filter_types text/plain application/xml; } ``` #### 4. 替换所有匹配项 如果希望替换所有匹配的字符串而不仅仅是第一个匹配项,可以将 `sub_filter_once` 设置为 `off`: ```nginx location / { sub_filter 'old_string' 'new_string'; sub_filter_once off; } ``` #### 5. 修改响应头中的 `Last-Modified` 字段 当启用 `sub_filter_last_modified` 时,Nginx 会修改响应头中的 `Last-Modified` 字段,以反映内容修改后的时间: ```nginx location / { sub_filter 'old_string' 'new_string'; sub_filter_last_modified on; } ``` ### 注意事项 - `ngx_http_sub_module` 仅支持简单的字符串替换,不支持正则表达式匹配。如果需要更复杂的替换逻辑,可以考虑使用第三方模块 `ngx_http_substitutions_filter_module`。 - 替换操作会对性能产生一定影响,尤其是在大文件或高并发场景下。因此,建议仅在必要时启用该功能。 - 替换操作会影响响应内容的大小,可能导致 `Content-Length` 头部字段不准确。Nginx 会自动处理这种情况,但某些客户端可能会受到影响。
阅读全文

相关推荐

[root@VM-24-11-opencloudos nginx-1.24.0]# ./configure --prefix=/www/server/nginx --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --with-openssl=/www/server/nginx/src/openssl --with-pcre=/usr/local/src/pcre-8.43 --w ith-http_v2_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_stu b_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --wi th-http_gunzip_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_modul e --with-http_realip_module --with-http_mp4_module --add-module=/www/server/nginx/src/ngx_http_substitutio ns_filter_module-master --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-http_dav_module --add-module= /www/server/nginx/src/nginx-dav-ext-module --add-module=/usr/local/fastdfs-nginx-module/src checking for OS + Linux 6.6.47-12.oc9.x86_64 x86_64 checking for C compiler ... found + using GNU C compiler + gcc version: 12.3.1 20230912 (OpenCloudOS 12.3.1.3-1) (Tencent Compiler 12.3.1.3) checking for gcc -pipe switch ... found checking for --with-ld-opt="-Wl,-E" ... found checking for -Wl,-E switch ... found checking for gcc builtin atomic operations ... found checking for C99 variadic macros ... found checking for gcc variadic macros ... found checking for gcc builtin 64 bit byteswap ... found checking for unistd.h ... found checking for inttypes.h ... found checking for limits.h ... found checking for sys/filio.h ... not found checking for sys/param.h ... found checking for sys/mount.h ... found checking for sys/statvfs.h ... found checking for crypt.h ... found checking for Linux specific features checking for epoll ... found checking for EPOLLRDHUP ... found checking for EPOLLEXCLUSIVE ... found checking for eventfd() ... found checking for O_PATH ... found checking for sendfile() ... found checking for sendfile64() ... found checking for sys/prctl.h ... found checking for prctl(PR_SET_DUMPABLE) ... found checking for prctl(PR_SET_KEEPCAPS) ... found checking for capabilities ... found checking for crypt_r() ... found checking for sys/vfs.h ... found checking for UDP_SEGMENT ... found checking for nobody group ... found checking for poll() ... found checking for /dev/poll ... not found checking for kqueue ... not found checking for crypt() ... not found checking for crypt() in libcrypt ... found checking for F_READAHEAD ... not found checking for posix_fadvise() ... found checking for O_DIRECT ... found checking for F_NOCACHE ... not found checking for directio() ... not found checking for statfs() ... found checking for statvfs() ... found checking for dlopen() ... found checking for sched_yield() ... found checking for sched_setaffinity() ... found checking for SO_SETFIB ... not found checking for SO_REUSEPORT ... found checking for SO_ACCEPTFILTER ... not found checking for SO_BINDANY ... not found checking for IP_TRANSPARENT ... found checking for IP_BINDANY ... not found checking for IP_BIND_ADDRESS_NO_PORT ... found checking for IP_RECVDSTADDR ... not found checking for IP_SENDSRCADDR ... not found checking for IP_PKTINFO ... found checking for IPV6_RECVPKTINFO ... found checking for TCP_DEFER_ACCEPT ... found checking for TCP_KEEPIDLE ... found checking for TCP_FASTOPEN ... found checking for TCP_INFO ... found checking for accept4() ... found checking for int size ... 4 bytes checking for long size ... 8 bytes checking for long long size ... 8 bytes checking for void * size ... 8 bytes checking for uint32_t ... found checking for uint64_t ... found checking for sig_atomic_t ... found checking for sig_atomic_t size ... 4 bytes checking for socklen_t ... found checking for in_addr_t ... found checking for in_port_t ... found checking for rlim_t ... found checking for uintptr_t ... uintptr_t found checking for system byte ordering ... little endian checking for size_t size ... 8 bytes checking for off_t size ... 8 bytes checking for time_t size ... 8 bytes checking for AF_INET6 ... found checking for setproctitle() ... not found checking for pread() ... found checking for pwrite() ... found checking for pwritev() ... found checking for strerrordesc_np() ... found checking for localtime_r() ... found checking for clock_gettime(CLOCK_MONOTONIC) ... found checking for posix_memalign() ... found checking for memalign() ... found checking for mmap(MAP_ANON|MAP_SHARED) ... found checking for mmap("/dev/zero", MAP_SHARED) ... found checking for System V shared memory ... found checking for POSIX semaphores ... found checking for struct msghdr.msg_control ... found checking for ioctl(FIONBIO) ... found checking for ioctl(FIONREAD) ... found checking for struct tm.tm_gmtoff ... found checking for struct dirent.d_namlen ... not found checking for struct dirent.d_type ... found checking for sysconf(_SC_NPROCESSORS_ONLN) ... found checking for sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found checking for openat(), fstatat() ... found checking for getaddrinfo() ... found configuring additional modules adding module in /www/server/nginx/src/ngx_devel_kit + ngx_devel_kit was configured adding module in /www/server/nginx/src/lua_nginx_module checking for LuaJIT library in /usr/local/lib and /usr/local/include/luajit-2.1 (specified by the LUAJIT_LIB and LUAJIT_INC env, with -ldl) ... found checking for LuaJIT 2.x ... found checking for Lua language 5.1 ... found checking for LuaJIT has FFI ... found checking for export symbols by default (-E) ... found checking for export symbols by default (--export-all-symbols) ... not found checking for SO_PASSCRED ... found checking for SA_RESTART ... found checking for malloc_trim ... found checking for pipe2 ... found checking for signalfd ... found checking for execvpe ... found + ngx_http_lua_module was configured adding module in /www/server/nginx/src/ngx_cache_purge + ngx_http_cache_purge_module was configured adding module in /www/server/nginx/src/ngx_http_substitutions_filter_module-master + ngx_http_subs_filter_module was configured adding module in /www/server/nginx/src/nginx-dav-ext-module + ngx_http_dav_ext_module was configured adding module in /usr/local/fastdfs-nginx-module/src + ngx_http_fastdfs_module was configured checking for zlib library ... found checking for libxslt ... found checking for libexslt ... found checking for GD library ... found checking for GD WebP support ... found creating objs/Makefile Configuration summary + using PCRE library: /usr/local/src/pcre-8.43 + using OpenSSL library: /www/server/nginx/src/openssl + using system zlib library nginx path prefix: "/www/server/nginx" nginx binary file: "/www/server/nginx/sbin/nginx" nginx modules path: "/www/server/nginx/modules" nginx configuration prefix: "/www/server/nginx/conf" nginx configuration file: "/www/server/nginx/conf/nginx.conf" nginx pid file: "/www/server/nginx/logs/nginx.pid" nginx error log file: "/www/server/nginx/logs/error.log" nginx http access log file: "/www/server/nginx/logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp" ./configure: warning: the "--with-ipv6" option is deprecated [root@VM-24-11-opencloudos nginx-1.24.0]# make clean rm -rf Makefile objs [root@VM-24-11-opencloudos nginx-1.24.0]# make -j$(nproc) make: *** No targets specified and no makefile found. Stop.

[root@VM-24-11-opencloudos nginx-1.24.0]# ./configure --prefix=/www/server/nginx --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --with-openssl=/www/server/nginx/src/openssl --with-pcre=pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --add-module=/www/server/nginx/src/ngx_http_substitutions_filter_module-master --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-http_dav_module --add-module=/www/server/nginx/src/nginx-dav-ext-module --add-module=/usr/local/fastdfs-nginx-module/src checking for OS + Linux 6.6.47-12.oc9.x86_64 x86_64 checking for C compiler ... found + using GNU C compiler + gcc version: 12.3.1 20230912 (OpenCloudOS 12.3.1.3-1) (Tencent Compiler 12.3.1.3) checking for gcc -pipe switch ... found checking for --with-ld-opt="-Wl,-E" ... found checking for -Wl,-E switch ... found checking for gcc builtin atomic operations ... found checking for C99 variadic macros ... found checking for gcc variadic macros ... found checking for gcc builtin 64 bit byteswap ... found checking for unistd.h ... found checking for inttypes.h ... found checking for limits.h ... found checking for sys/filio.h ... not found checking for sys/param.h ... found checking for sys/mount.h ... found checking for sys/statvfs.h ... found checking for crypt.h ... found checking for Linux specific features checking for epoll ... found checking for EPOLLRDHUP ... found checking for EPOLLEXCLUSIVE ... found checking for eventfd() ... found checking for O_PATH ... found checking for sendfile() ... found checking for sendfile64() ... found checking for sys/prctl.h ... found checking for prctl(PR_SET_DUMPABLE) ... found checking for prctl(PR_SET_KEEPCAPS) ... found checking for capabilities ... found checking for crypt_r() ... found checking for sys/vfs.h ... found checking for UDP_SEGMENT ... found checking for nobody group ... found checking for poll() ... found checking for /dev/poll ... not found checking for kqueue ... not found checking for crypt() ... not found checking for crypt() in libcrypt ... found checking for F_READAHEAD ... not found checking for posix_fadvise() ... found checking for O_DIRECT ... found checking for F_NOCACHE ... not found checking for directio() ... not found checking for statfs() ... found checking for statvfs() ... found checking for dlopen() ... found checking for sched_yield() ... found checking for sched_setaffinity() ... found checking for SO_SETFIB ... not found checking for SO_REUSEPORT ... found checking for SO_ACCEPTFILTER ... not found checking for SO_BINDANY ... not found checking for IP_TRANSPARENT ... found checking for IP_BINDANY ... not found checking for IP_BIND_ADDRESS_NO_PORT ... found checking for IP_RECVDSTADDR ... not found checking for IP_SENDSRCADDR ... not found checking for IP_PKTINFO ... found checking for IPV6_RECVPKTINFO ... found checking for TCP_DEFER_ACCEPT ... found checking for TCP_KEEPIDLE ... found checking for TCP_FASTOPEN ... found checking for TCP_INFO ... found checking for accept4() ... found checking for int size ... 4 bytes checking for long size ... 8 bytes checking for long long size ... 8 bytes checking for void * size ... 8 bytes checking for uint32_t ... found checking for uint64_t ... found checking for sig_atomic_t ... found checking for sig_atomic_t size ... 4 bytes checking for socklen_t ... found checking for in_addr_t ... found checking for in_port_t ... found checking for rlim_t ... found checking for uintptr_t ... uintptr_t found checking for system byte ordering ... little endian checking for size_t size ... 8 bytes checking for off_t size ... 8 bytes checking for time_t size ... 8 bytes checking for AF_INET6 ... found checking for setproctitle() ... not found checking for pread() ... found checking for pwrite() ... found checking for pwritev() ... found checking for strerrordesc_np() ... found checking for localtime_r() ... found checking for clock_gettime(CLOCK_MONOTONIC) ... found checking for posix_memalign() ... found checking for memalign() ... found checking for mmap(MAP_ANON|MAP_SHARED) ... found checking for mmap("/dev/zero", MAP_SHARED) ... found checking for System V shared memory ... found checking for POSIX semaphores ... found checking for struct msghdr.msg_control ... found checking for ioctl(FIONBIO) ... found checking for ioctl(FIONREAD) ... found checking for struct tm.tm_gmtoff ... found checking for struct dirent.d_namlen ... not found checking for struct dirent.d_type ... found checking for sysconf(_SC_NPROCESSORS_ONLN) ... found checking for sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found checking for openat(), fstatat() ... found checking for getaddrinfo() ... found configuring additional modules adding module in /www/server/nginx/src/ngx_devel_kit + ngx_devel_kit was configured adding module in /www/server/nginx/src/lua_nginx_module checking for LuaJIT library in /usr/local/lib and /usr/local/include/luajit-2.1 (specified by the LUAJIT_LIB and LUAJIT_INC env, with -ldl) ... found checking for LuaJIT 2.x ... found checking for Lua language 5.1 ... found checking for LuaJIT has FFI ... found checking for export symbols by default (-E) ... found checking for export symbols by default (--export-all-symbols) ... not found checking for SO_PASSCRED ... found checking for SA_RESTART ... found checking for malloc_trim ... found checking for pipe2 ... found checking for signalfd ... found checking for execvpe ... found + ngx_http_lua_module was configured adding module in /www/server/nginx/src/ngx_cache_purge + ngx_http_cache_purge_module was configured adding module in /www/server/nginx/src/ngx_http_substitutions_filter_module-master + ngx_http_subs_filter_module was configured adding module in /www/server/nginx/src/nginx-dav-ext-module + ngx_http_dav_ext_module was configured adding module in /usr/local/fastdfs-nginx-module/src + ngx_http_fastdfs_module was configured checking for zlib library ... found checking for libxslt ... found checking for libexslt ... found checking for GD library ... found checking for GD WebP support ... found creating objs/Makefile Configuration summary + using PCRE library: pcre-8.43 + using OpenSSL library: /www/server/nginx/src/openssl + using system zlib library nginx path prefix: "/www/server/nginx" nginx binary file: "/www/server/nginx/sbin/nginx" nginx modules path: "/www/server/nginx/modules" nginx configuration prefix: "/www/server/nginx/conf" nginx configuration file: "/www/server/nginx/conf/nginx.conf" nginx pid file: "/www/server/nginx/logs/nginx.pid" nginx error log file: "/www/server/nginx/logs/error.log" nginx http access log file: "/www/server/nginx/logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp" ./configure: warning: the "--with-ipv6" option is deprecated [root@VM-24-11-opencloudos nginx-1.24.0]# ^C [root@VM-24-11-opencloudos nginx-1.24.0]# make make -f objs/Makefile make[1]: Entering directory '/www/server/nginx/src/nginx-1.24.0' cd pcre-8.43 \ && if [ -f Makefile ]; then make distclean; fi \ && CC="cc" CFLAGS="-O2 -fomit-frame-pointer -pipe " \ ./configure --disable-shared /bin/sh: line 1: cd: pcre-8.43: No such file or directory make[1]: *** [objs/Makefile:2256: pcre-8.43/Makefile] Error 1 make[1]: Leaving directory '/www/server/nginx/src/nginx-1.24.0' make: *** [Makefile:10: build] Error 2

[root@VM-24-11-opencloudos nginx-1.24.0]# pcre-config --version 8.35 [root@VM-24-11-opencloudos nginx-1.24.0]# ./configure --prefix=/www/server/nginx --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --with-openssl=/www/server/nginx/src/openssl --with-pcre=pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --add-module=/www/server/nginx/src/ngx_http_substitutions_filter_module-master --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-http_dav_module --add-module=/www/server/nginx/src/nginx-dav-ext-module --add-module=/usr/local/fastdfs-nginx-module/src checking for OS + Linux 6.6.47-12.oc9.x86_64 x86_64 checking for C compiler ... found + using GNU C compiler + gcc version: 12.3.1 20230912 (OpenCloudOS 12.3.1.3-1) (Tencent Compiler 12.3.1.3) checking for gcc -pipe switch ... found checking for --with-ld-opt="-Wl,-E" ... found checking for -Wl,-E switch ... found checking for gcc builtin atomic operations ... found checking for C99 variadic macros ... found checking for gcc variadic macros ... found checking for gcc builtin 64 bit byteswap ... found checking for unistd.h ... found checking for inttypes.h ... found checking for limits.h ... found checking for sys/filio.h ... not found checking for sys/param.h ... found checking for sys/mount.h ... found checking for sys/statvfs.h ... found checking for crypt.h ... found checking for Linux specific features checking for epoll ... found checking for EPOLLRDHUP ... found checking for EPOLLEXCLUSIVE ... found checking for eventfd() ... found checking for O_PATH ... found checking for sendfile() ... found checking for sendfile64() ... found checking for sys/prctl.h ... found checking for prctl(PR_SET_DUMPABLE) ... found checking for prctl(PR_SET_KEEPCAPS) ... found checking for capabilities ... found checking for crypt_r() ... found checking for sys/vfs.h ... found checking for UDP_SEGMENT ... found checking for nobody group ... found checking for poll() ... found checking for /dev/poll ... not found checking for kqueue ... not found checking for crypt() ... not found checking for crypt() in libcrypt ... found checking for F_READAHEAD ... not found checking for posix_fadvise() ... found checking for O_DIRECT ... found checking for F_NOCACHE ... not found checking for directio() ... not found checking for statfs() ... found checking for statvfs() ... found checking for dlopen() ... found checking for sched_yield() ... found checking for sched_setaffinity() ... found checking for SO_SETFIB ... not found checking for SO_REUSEPORT ... found checking for SO_ACCEPTFILTER ... not found checking for SO_BINDANY ... not found checking for IP_TRANSPARENT ... found checking for IP_BINDANY ... not found checking for IP_BIND_ADDRESS_NO_PORT ... found checking for IP_RECVDSTADDR ... not found checking for IP_SENDSRCADDR ... not found checking for IP_PKTINFO ... found checking for IPV6_RECVPKTINFO ... found checking for TCP_DEFER_ACCEPT ... found checking for TCP_KEEPIDLE ... found checking for TCP_FASTOPEN ... found checking for TCP_INFO ... found checking for accept4() ... found checking for int size ... 4 bytes checking for long size ... 8 bytes checking for long long size ... 8 bytes checking for void * size ... 8 bytes checking for uint32_t ... found checking for uint64_t ... found checking for sig_atomic_t ... found checking for sig_atomic_t size ... 4 bytes checking for socklen_t ... found checking for in_addr_t ... found checking for in_port_t ... found checking for rlim_t ... found checking for uintptr_t ... uintptr_t found checking for system byte ordering ... little endian checking for size_t size ... 8 bytes checking for off_t size ... 8 bytes checking for time_t size ... 8 bytes checking for AF_INET6 ... found checking for setproctitle() ... not found checking for pread() ... found checking for pwrite() ... found checking for pwritev() ... found checking for strerrordesc_np() ... found checking for localtime_r() ... found checking for clock_gettime(CLOCK_MONOTONIC) ... found checking for posix_memalign() ... found checking for memalign() ... found checking for mmap(MAP_ANON|MAP_SHARED) ... found checking for mmap("/dev/zero", MAP_SHARED) ... found checking for System V shared memory ... found checking for POSIX semaphores ... found checking for struct msghdr.msg_control ... found checking for ioctl(FIONBIO) ... found checking for ioctl(FIONREAD) ... found checking for struct tm.tm_gmtoff ... found checking for struct dirent.d_namlen ... not found checking for struct dirent.d_type ... found checking for sysconf(_SC_NPROCESSORS_ONLN) ... found checking for sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found checking for openat(), fstatat() ... found checking for getaddrinfo() ... found configuring additional modules adding module in /www/server/nginx/src/ngx_devel_kit + ngx_devel_kit was configured adding module in /www/server/nginx/src/lua_nginx_module checking for LuaJIT library in /usr/local/lib and /usr/local/include/luajit-2.1 (specified by the LUAJIT_LIB and LUAJIT_INC env, with -ldl) ... found checking for LuaJIT 2.x ... found checking for Lua language 5.1 ... found checking for LuaJIT has FFI ... found checking for export symbols by default (-E) ... found checking for export symbols by default (--export-all-symbols) ... not found checking for SO_PASSCRED ... found checking for SA_RESTART ... found checking for malloc_trim ... found checking for pipe2 ... found checking for signalfd ... found checking for execvpe ... found + ngx_http_lua_module was configured adding module in /www/server/nginx/src/ngx_cache_purge + ngx_http_cache_purge_module was configured adding module in /www/server/nginx/src/ngx_http_substitutions_filter_module-master + ngx_http_subs_filter_module was configured adding module in /www/server/nginx/src/nginx-dav-ext-module + ngx_http_dav_ext_module was configured adding module in /usr/local/fastdfs-nginx-module/src + ngx_http_fastdfs_module was configured checking for zlib library ... found checking for libxslt ... found checking for libexslt ... found checking for GD library ... found checking for GD WebP support ... found creating objs/Makefile Configuration summary + using PCRE library: pcre-8.43 + using OpenSSL library: /www/server/nginx/src/openssl + using system zlib library nginx path prefix: "/www/server/nginx" nginx binary file: "/www/server/nginx/sbin/nginx" nginx modules path: "/www/server/nginx/modules" nginx configuration prefix: "/www/server/nginx/conf" nginx configuration file: "/www/server/nginx/conf/nginx.conf" nginx pid file: "/www/server/nginx/logs/nginx.pid" nginx error log file: "/www/server/nginx/logs/error.log" nginx http access log file: "/www/server/nginx/logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp" ./configure: warning: the "--with-ipv6" option is deprecated [root@VM-24-11-opencloudos nginx-1.24.0]# make make -f objs/Makefile make[1]: Entering directory '/www/server/nginx/src/nginx-1.24.0' cd pcre-8.43 \ && if [ -f Makefile ]; then make distclean; fi \ && CC="cc" CFLAGS="-O2 -fomit-frame-pointer -pipe " \ ./configure --disable-shared /bin/sh: line 1: cd: pcre-8.43: No such file or directory make[1]: *** [objs/Makefile:2256: pcre-8.43/Makefile] Error 1 make[1]: Leaving directory '/www/server/nginx/src/nginx-1.24.0' make: *** [Makefile:10: build] Error 2

server { listen 8080; server_name 192.168.190.47; # 开启错误拦截 proxy_intercept_errors on; # 启用响应内容替换功能 sub_filter_once off; sub_filter_types text/html; # 移除例外情况部分 sub_filter '例外情况[^<]*[^<]*' ''; # 移除根本原因部分 sub_filter '根本原因。[^<]*[^<]*' ''; # 移除最后的备注信息 sub_filter '注意 主要问题的全部 stack 信息可以在 server logs 里查看' ''; # 隐藏服务器信息 server_tokens off; proxy_hide_header X-Powered-By; proxy_hide_header Server; #后台服务配置,配置了这个location便可以通过http://域名/jeecg-boot/xxxx 访问 location ^~ /snnb-boot { proxy_pass http://192.168.190.96:8082/snnb-boot/; proxy_set_header Host 192.168.190.96; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } #后台服务配置,配置了这个location便可以通过http://域名/jeecg-boot/xxxx 访问 location ^~ /snbtss-boot { proxy_pass http://192.168.190.96:8083/snbtss-boot/; proxy_set_header Host 192.168.190.96; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location ^~ /kkfileview/ { proxy_pass http://192.168.190.50:8013/kkfileview/; } location ^~ /snfs { proxy_pass http://192.168.190.51:8888/snfs/; } #解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题 location /snnbip { root html; index index.html index.htm; if (!-e $request_filename) { rewrite ^(.*)$ /snnbip/index.html?s=$1 last; break; } } location /snnb { root html; index index.html index.htm; if (!-e $request_filename) { rewrite ^(.*)$ /snnb/index.html?s=$1 last; break; } } } 替换配置没有生效

最新推荐

recommend-type

基于Python实现的信息检索与文本挖掘综合搜索引擎系统-包含网络爬虫模块-网页内容解析与分词处理-索引构建与数据库存储-Web查询服务与结果展示-用于课程大作业与学术研究-技术栈.zip

jdk1.8基于Python实现的信息检索与文本挖掘综合搜索引擎系统_包含网络爬虫模块_网页内容解析与分词处理_索引构建与数据库存储_Web查询服务与结果展示_用于课程大作业与学术研究_技术栈.zip
recommend-type

企业网络结构设计与拓扑图的PKT文件解析

企业网络拓扑设计是网络架构设计的一个重要组成部分,它涉及到企业内部网络的布局结构,确保信息传递的高效和网络安全。网络拓扑设计需要详细规划网络中每个组件的位置、连接方式、设备类型等关键要素。在设计过程中,通常会使用网络拓扑图来形象地表示这些组件和它们之间的关系。 网络拓扑设计中重要的知识点包括: 1. 拓扑图的类型:网络拓扑图主要有以下几种类型,每一种都有其特定的应用场景和设计要求。 - 总线拓扑:所有设备都连接到一条共享的主干线上,信息在全网中广播。适合小型网络,维护成本低,但故障排查较为困难。 - 星型拓扑:所有设备通过点对点连接到一个中心节点。便于管理和监控,中心节点的故障可能导致整个网络瘫痪。 - 环形拓扑:每个节点通过专用链路形成一个闭合环路。信息单向流动,扩展性较差,对单点故障敏感。 - 网状拓扑:网络中的设备通过多条路径连接,提供极高的冗余性。适合大型网络,成本较高。 2. 网络设备的选择:网络设备包括路由器、交换机、防火墙、无线接入点等。设计时需根据实际需求选择适合的设备类型和配置。 3. IP地址规划:合理的IP地址分配能确保网络的有序运行,包括私有地址和公有地址的规划,子网划分,以及IP地址的动态分配(DHCP)和静态分配。 4. 网络安全设计:保护企业网络不受攻击至关重要。包括设置防火墙规则、配置入侵检测系统(IDS)、实施访问控制列表(ACL)等安全策略。 5. 网络冗余和负载均衡:为防止网络中的单点故障,设计时需要考虑使用冗余技术和负载均衡技术,例如多线路接入、链路聚合、VRRP(虚拟路由器冗余协议)等。 6. 物理布线规划:这是指网络中的物理连接方式和布线方案,通常根据实际建筑环境和网络设备位置来决定,包括线缆的种类和长度限制等。 7. 虚拟化和云计算:在现代企业网络设计中,虚拟化技术和云计算服务的集成也变得越来越重要,需要合理规划服务器资源和云服务接口。 从提供的文件描述来看,包含了详细的网络结构设计和拓扑图PKT文件,以及源代码。这说明该课设文件不仅包括了网络拓扑图的视觉展示,还涉及到了实际的网络配置和编程实现。PKT文件可能指的是Packet Tracer(网络模拟软件)生成的网络拓扑文件, Packet Tracer 是Cisco开发的网络模拟工具,用户可以通过它创建网络拓扑图并模拟网络设备之间的数据通信。 由于文件名仅标注为“课设”,我们无法得知具体的课程名称或者网络拓扑设计的具体案例。不过,可以推测这份文件可能是一个教学材料或课程设计项目,旨在帮助学生或者网络工程师通过实践来加深对网络拓扑设计的理解和应用。其中包含的源代码可能是用于配置网络设备(如路由器和交换机的命令脚本),或者是一些网络应用的编程实现,比如网络监控工具或者数据分析脚本等。
recommend-type

【技术解读】:5个步骤深入自定义你的Winform窗口

# 摘要 本文全面概述了Winform窗口自定义开发的关键方面,涵盖了从基础操作到高级功能开发以及性能调优的各个方面。文章首先介绍了Winform窗口的基本操作、设计元素及响应式设计实现方法。随后,深入探讨了自定义控件创建、多线程处理以及插件机制等高级功能开发技术。为了优化交互体验,文中还阐述了用户输入处理、动画效果集成以及高级用户界面交互技术。此外,文章详细讨论了窗口的国
recommend-type

ARM/x86/c86 的具体区别

<think>好的,用户之前问过国产化服务器和操作系统,现在又想知道ARM、x86、x86的具体区别。看起来用户可能是在做技术选型或者需要了解不同架构的优缺点,以便在实际项目中选择合适的硬件和系统。 首先,用户提到的c86可能是个笔误,应该是x86。需要确认这一点,避免误解。然后需要分别从架构、设计理念、应用场景、性能、生态等方面对比ARM和x86。另外,用户可能对国产芯片如鲲鹏、飞腾等基于ARM的处理器感兴趣,所以需要联系之前的回答,说明这些国产芯片的架构背景。 接下来,需要检查技术细节的准确性,比如指令集类型、功耗、扩展性、授权模式等。还要考虑用户可能的实际需求,比如是否需要低功耗设备
recommend-type

最新Swift语言iOS开发实战教程免费下载

标题《Intermediate_swift_ios_12_book》表明了本书是一本关于Swift语言以及iOS 12平台的中阶开发教程。在Swift语言方面,它侧重于深入探讨和实践,旨在帮助读者提升在iOS开发方面的技能水平。自从2014年苹果公司首次推出Swift语言以来,它就成为了开发iOS、macOS、watchOS和tvOS应用的首选语言。Swift语言以其安全、快速、现代的特性逐渐取代了Objective-C,成为苹果生态系统中的主流开发语言。iOS 12作为苹果公司推出的最新操作系统版本,它引入了许多新特性,比如ARKit 2、MeasureKit和新的Screen Time功能,因此开发者需要学习和适应这些变化以充分利用它们。 描述强调了这本书是由Appcoda出版的,Appcoda是一家专注于提供高质量iOS和Swift编程教程的在线平台。通过Appcoda出版的教程,读者通常能够获得紧跟行业标准和实践的教学材料。此书被推荐给希望学习使用最新的Swift语言进行iOS开发的人群。这暗示了该书涵盖了iOS 12的新特性和API,这些内容对于想要掌握最新开发技术的开发者来说至关重要。 标签"ios swift programming practice"则进一步明确了这本书的三个主要知识点:iOS开发、Swift编程和编程实践。这些标签指向了iOS开发的核心技能和知识领域。iOS开发涉及到使用Xcode作为主要的开发环境,掌握使用Interface Builder构建用户界面,以及理解如何使用UIKit框架来创建和管理用户界面。Swift编程则集中在语言本身,包括其基本语法、类型系统、面向协议编程、闭包、泛型等高级特性。编程实践则强调实际编写代码的能力,如编写可测试、可维护和高性能的代码,以及如何使用设计模式来解决常见的开发问题。 文件名称列表中的"Intermediate swift ios12 book.epub"指出了该教程的电子书格式。EPUB是一种广泛使用的电子书标准格式,它支持可调整的布局,使得内容在不同尺寸的屏幕上都可阅读。EPUB格式允许用户在各种阅读设备上阅读书籍,如平板电脑、智能手机、电子书阅读器等。而文件名"._Intermediate swift ios12 book.epub"前面的点和下划线可能表明这是一个隐藏文件或在某种特定环境下被创建的临时文件。 综上所述,知识点涉及: 1. Swift语言基础:Swift是一种安全、快速、现代的编程语言,由苹果公司开发,用于iOS、macOS、watchOS和tvOS应用的开发。Swift语言的特性包括语法简洁、类型安全、内存管理自动化、对闭包和泛型的支持等。 2. iOS 12平台特性:iOS 12作为当时较新的操作系统版本,提供了许多新API和功能,如ARKit 2、MeasureKit等。开发者需要掌握如何在应用中利用这些API实现增强现实(AR)、时间管理等高级功能。 3. Xcode和UIKit框架:Xcode是iOS开发的主要集成开发环境(IDE),它提供了代码编辑器、调试工具、性能分析工具以及用户界面构建器等工具。UIKit框架是构建iOS应用用户界面的基础框架,它提供了丰富的用户界面组件和控件。 4. Swift高级特性和编程实践:学习Swift的高级特性有助于编写高效和可维护的代码。这包括理解闭包的使用、泛型编程、面向协议的设计等。同时,学习和实践良好的编程习惯,如编写可测试的代码、应用设计模式、以及遵循苹果的编码规范和最佳实践。 5. Appcoda及其教程特点:Appcoda是一家提供高质量iOS和Swift编程教程的平台,其教学材料通常紧跟技术发展和行业标准,很适合用于自我学习和提升技能。
recommend-type

【核心攻略】:掌握Winform界面构建的10大黄金法则

# 摘要 Winform界面构建是开发桌面应用程序的重要组成部分,本文从界面布局、数据管理、性能优化、安全性以及进阶技术等多方面进行深入探讨。第一章提供了一个概览,接下来的章节分别详细阐述了如何设计高效的Winform布局,包括布局容器的选择与嵌套布局策略;如何通过数据绑定简化数据管理并保证数据的正确性;以及如何优化界面性能,提高渲染效率并
recommend-type

给我讲解一下boost升压电路

<think>嗯,用户想了解Boost升压电路的工作原理和应用场景。首先,我需要回忆一下Boost电路的基本结构。根据引用[1],Boost升压电路由控制IC、功率电感和MOSFET组成,非同步Boost架构可能更简单,适合用来解释原理。那它的工作原理是怎样的呢? 记得Boost电路属于开关电源,通过开关管的通断来控制电感储能和释放。当MOSFET导通时,电流流过电感,电感开始储能,此时二极管截止,电容负责维持输出电压。而当MOSFET关闭时,电感电流不能突变,会产生反向电动势,这时候电感的电压加上输入电压,通过二极管给电容充电,从而提升输出电压。这个过程需要控制IC来调节开关的占空比,以维
recommend-type

全国国道矢量数据下载与arcgis软件应用

根据提供的文件信息,我们可以生成以下知识点: ### 地理信息系统(GIS) 地理信息系统,简称GIS,是一种特定的、全面的信息系统,它用来捕捉、存储、操纵、分析、管理和呈现地理数据。GIS技术可以对空间数据进行分析,以解决各种地理问题。在GIS中,空间数据通常包括矢量数据和栅格数据。矢量数据是一种图形化的数据格式,用于表示地图上的点、线、面等要素。 ### 国道数据 国道数据特指中国境内的国道信息,国道是指国家主要干线公路,具有连接城市、具有较大运输量、承担全国公路运输主要任务的特点。国道数据可以包括道路的位置、长度、宽度、类型、交通流量等信息。在地理信息系统中,国道数据的准确性对于路线规划、交通管理、城市规划等多个领域至关重要。 ### 矢量数据 矢量数据是GIS中的一个关键概念,它利用几何图形(如点、线、多边形等)来表示真实世界中的物体或区域。矢量数据与栅格数据相对,栅格数据通过像素阵列来表示信息,而矢量数据则通过坐标表示形状和位置。矢量数据具备以下几个特点: - 可无限放大缩小而不失真。 - 在空间分析和拓扑运算方面具有优势。 - 数据量相对较小,易于编辑和管理。 - 可以更好地表达地理要素的属性信息。 ### ArcGIS软件 ArcGIS是由美国Esri公司开发的地理信息系统软件,是业界广泛使用的一套GIS软件平台。ArcGIS提供了众多的工具来捕捉、分析、管理、展示地理信息。用户可以利用ArcGIS进行数据编辑、地图制作、地理分析、数据管理和应用开发等多种操作。ArcGIS支持多种数据格式,包括我们这里提到的矢量数据格式。 ### SHP文件格式 SHP文件格式是一种流行的矢量数据文件格式,它是由Esri公司在其ArcGIS产品中创建的一种空间数据存储格式,用于存储空间和属性信息。SHP文件包含了构成矢量图形的几何形状(点、线、面)和相关的属性信息。每个SHP文件通常都伴随着DBF文件(属性表)和.prj文件(定义空间参考系统的文件)。SHP格式由于其广泛的支持和开放性,成为了交换GIS数据的常用格式之一。 ### 全国国道数据的应用 全国国道数据在GIS中的应用非常广泛,包括但不限于: - **交通规划**:分析国道的通行能力,规划新的交通线路,优化现有路线。 - **应急响应**:在自然灾害或紧急情况中,用于规划救援路线和物资分配。 - **市政建设**:帮助规划城市扩展、土地利用以及基础设施建设。 - **旅游规划**:制定旅游路线,提升旅游服务的便捷性和舒适度。 - **车辆导航**:为导航系统提供精确的道路数据,帮助驾驶者快速到达目的地。 ### 数据处理与分析 利用ArcGIS等GIS软件,用户可以对全国国道数据进行一系列的空间分析和处理。包括但不限于以下几点: - **缓冲区分析**:分析国道周边一定范围内的情况,如人口分布、环境影响等。 - **网络分析**:进行道路连通性分析,为交通管理提供决策支持。 - **叠加分析**:将国道数据与其他地理数据层进行叠加,提取有用信息。 - **数据转换**:将国道数据转换为不同格式或投影,以适应不同的GIS平台或系统。 ### 数据共享与标准化 为了促进数据的共享和再利用,国家和地方制定了相应的GIS数据标准和规范。通过标准化的数据格式,不同的机构和组织可以交换数据,从而在更广泛的范围内发挥GIS数据的作用。对于全国国道数据而言,使用标准格式和协议可以提高数据的互操作性,便于进行区域间的协作与信息交流。 总结来说,全国国道数据作为一种重要的地理信息资源,对于国家交通网络的建设和管理具有重要的参考价值。通过GIS软件,特别是ArcGIS,用户可以充分利用矢量数据格式的优点,进行深入的数据分析和应用开发,从而更好地服务于社会经济发展和公众的日常需要。
recommend-type

Creo 1.0曲面设计宝典:提升模型质量的光顺技巧

# 摘要 本文旨在全面介绍Creo软件在曲面设计领域的应用,涵盖了从理论基础到高级技巧的全方位知识。首先,文章概述了Creo曲面设计的概念和重要性,随后深入探讨了曲面光顺的理论基础,包括曲面的连续性和曲率分析方法,以及光顺技术的数学原理。接着,文章通过实例操作演示了如何在Creo中高效执行曲面光顺,并分享了提高光顺效率的技巧。进一步地,介绍了优化曲面设计的高级技巧,重点在于复杂曲面建模策略和模型优化方法。最后,探讨了曲面设计评审与质量控制的最佳实践,并对曲面设计技术未来的发展趋势进行了展望,强调了新兴技术和人工智能的潜在应用。 # 关键字 Creo曲面设计;曲面光顺;曲面连续性;曲面曲率分析
recommend-type

DevEco Studio 如何全局加分号的快捷键

<think>好的,用户想了解在DevEco Studio中如何设置全局添加分号的快捷键。首先,我需要回忆一下DevEco Studio的快捷键设置方式,因为它是基于IntelliJ平台的,所以可能和Android Studio或者IDEA类似。 根据用户提供的引用内容,特别是引用[2]提到在Android Studio中可以使用Ctrl+Shift+Enter快速补全分号。但用户现在是在DevEco Studio中寻找类似功能。我需要确认DevEco Studio是否有相同的快捷键,或者需要自定义设置。 首先,全局添加分号可能指的是在代码中自动补全分号,尤其是在行尾添加。这通常与代码补全