服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. linux nginx
  3. 如何使用nginx子filterreplacejs文件variables
Intereting Posts
EC2configuration 最安全的Apache / MySQL / PHP组合发行? 购买新机器:品牌忠诚 是否可以重新安排pipe理安装点? InstallShield在安装过程中是否保留日志? ssh -N窃取按键 DNS永远 – 使用Pingdom 使用terminal访问已经通过SMB安装的目录/文件? 为什么玩! 当我尝试使用ant构build时,无法识别JDK? Linux上的软件RAID 10 间歇性sudo故障 – SuSE 10 nginx和PHP-FPM之间的通信失败 如何将IP添加到CentOS服务器? 最好的方法来validation一个cronjob执行与Nagios通知失败? 是否可以检查Busybox系统上的NTPd状态?

如何使用nginx子filterreplacejs文件variables

我想在运行时使用NGINX子filterreplacejs文件中的IP。
我已经添加了sub_filter的位置,但它不工作。

我的nginx.config文件是

location ~ \.js { sub_filter "###IP###" "$remote_addr"; sub_filter_once off; sub_filter_types application/x-javascript; add_header Content-Type application/x-javascript; } 

而我的JS代码是

 var IP = "###IP###"; console.log(IP); 

但IP在这样的控制台中打印###IP###

  • 静态路由在有两个NIC的Linux服务器上有时会停止工作
  • 如何禁用laravel中的文件URL的gzip
  • 在Upstart脚本中以非root用户身份运行守护程序
  • openvpn – 添加对等体时存在文件
  • syslog-ng 3.2.5服务器停止接收数据,可能与logrotate有关

我的代码中有什么问题?

  • 端口不在Centos 7中
  • Apache错误“无法绑定到地址”
  • 系统模板有多个值
  • 与更多类似的进程配对时,进程CPU%会翻倍
  • TFTP传输超时Centos7
  • TLS握手错误
  • 挂载+testing挂载点从fstab真正安装到相关的分区
  • 在proxmox中的虚拟机之间共享硬盘的最佳方式
  • rsync之后权限被拒绝(publickey)
  • iperf带宽小于接口速度
  • 我应该使用SO_REUSEPORT,如果在许multithreading中使用相同的IP:端口有多个套接字接受器?
  • 如何在债券中find从属接口的信息?
  • 避免bash脚本等待用户input回车键
  • 等同于networking状态的network-online.target
  • 不能在Centos7上针对AD进行ISE(802.1)authentication

  • © 2017 服务器 Gind.cn
  • Topics
  •        
  • Powered by Server
  • Privacy Policy