Adding remote IP in javascript with nginx
js.js:
var IP = "###IP###";
nginx.conf (location):
sub_filter "###IP###" "$remote_addr";
sub_filter_once on;
sub_filter_types application/x-javascript;
This module can search and replace text in the nginx response. It is only available if the:
--with-http_sub_module option
Written by Cícero Verneck Corrêa
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Js
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#