Welcome! Log In Create A New Profile

Advanced

nginx 1.10.2 и sub_filter не работает

December 14, 2016 01:08AM
Всем привет.
Захотелось странного :) - перезаписывать в респонзе из файлика, который отдает nginx некую переменную в соответствии с мапой.
Но не работает почему-то :(
Вот инфа по nginx:
nginx version: nginx/1.10.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --user=nginx --group=nginx --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/mnt/resource/nginx/client_temp --http-proxy-temp-path=/mnt/resource/nginx/proxy_temp --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module --with-file-aio --with-ipv6 --with-http_geoip_module --without-http_scgi_module --without-http_uwsgi_module --without-http_fastcgi_module --with-http_v2_module

Вот конфиг:
server {
listen 80;
server_name ~^(www\.)?(.+)\.com;
root /var/www/fake.site;
sub_filter '{{hostname}}' some_shit;
sub_filter_once on;
}

Вот содержимое js-файла, которое хотелось бы перезаписать:
define(['config'], function(config){
return config = { basehost: '{{hostname}}', timeout: '500'}
});

Что я делаю не так? Или таки нужно заюзать сторонний модуль тип этого: https://github.com/yaoweibin/ngx_http_substitutions_filter_module
Subject Author Posted

nginx 1.10.2 и sub_filter не работает

YuriV December 14, 2016 01:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 125
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready