HttpSubsModule ... problem with spaces in strings
May 20, 2015 06:32AM
Hi forum....

I'm using subs_filter in some of my sites nicely... but now I'm dealing with a situation where I'm completely stuck...
Documentation is scarce and my knowledge limited... so:

Does somebody know how to use HttpSubsModule (or whatever else) to replace strings that DO CONTAIN spaces amid string?

Best regrads!
Re: HttpSubsModule ... problem with spaces in strings
May 20, 2015 06:59AM
Have you tried enclosing them with quotes "" ?

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: HttpSubsModule ... problem with spaces in strings
May 20, 2015 07:40AM
Hi!

Yes, I did... In fact subs_filter does grat job replacing strings such as src="/localf with src="http://remot
the problem comes with spaces as I want to alter pieces of html code as they return from the proxied server (basically I want to hide or completely remove a div I do not want to appear on the site).

It is the only way I know off on how to filter a piece of a website I'm proxying and I do not want to be shown.
Re: HttpSubsModule ... problem with spaces in strings
May 20, 2015 08:02AM
If this doesn't work you need to use Lua,
http://stackoverflow.com/questions/26436891/nginx-lua-modify-html-response-after-proxy-pass

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: HttpSubsModule ... problem with spaces in strings
May 20, 2015 09:41AM
ouch!....

I was affraid of this reply... seems I should park the matter for the time being.
the complexity of LUA is scaring, and also means recompile my production nginx server...., I know it is surely the only way to go... but too much overhead...

but thank you very much for your help!
Best regards!!!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 115
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready