I've been having a bit of difficulty setting up nginx on my ubuntu server. Right now its configured to proxy another website. I want to add some content to the main page right after <body>
. I used:
subs_filter '<body>' '<body>' My content;
This works great, the only problem is that it's at every page, How can I use an if statement or something to make it only appear on the homepage. I tried going with
if ($uri ~ 'index.php')
then do the above filter but that gives an error saying nginx: [emerg] "subs_filter" directive is not allowed here
.
I looked it up but had a lot of trouble finding what I need :(.