Search code examples
nginxstatic-files

How can I modify static HTML file served by Nginx?


I want to modify static HTML file served by Nginx, i.e. substitute "FOO" for "BAR" (for example, to inject user's IP address in javascript variable).

I don't want to setup full PHP/Python etc. app for this simple task.

Is it possible with Nginx only?


Solution

  • You can do this with ngx_http_sub_module.