Privoxy, proxy some domain, and exclude some sub-domain - proxy

I use privoxy action file for proxy some domain, it works well
{{alias}}
proxy = +forward-override{forward-socks5 localhost:55501 .}
{proxy}
.demo1.com
.demo2.com
now I want exclude some sub-domain, for example:
noproxy.demo1.com
What should I write in the action file ?

Try to put this code behind:
{-forward-override}
noproxy.demo1.com
- to disable.
And From the manual:
For multi-valued actions, the actions are applied in the order they are specified.

Got the same issue. The answer above is almost correct.
Documentation on https://www.privoxy.org/user-manual/actions-file.html#FORWARD-OVERRIDE says
"forward ." to use a direct connection without any additional proxies.
So, correcting the previous answer:
{+forward-override{forward .}}
yourdomain.com
Will do bypass the proxies for yourdomain.com

Related

look for assistance with the url rewrite module in IIS

I'm trying to set up a reverse proxy for single sign on to an application. the URL to reach my app and the defined authentication method is "http://servername.domain/app/main?authsource=sso_rp"
My current config just sends me to the application login prompt. I've tested my authentication source and confirmed its working. My question is, does my URL rewrite config look like it should? there are no conditions or variables defined. i know I'm missing something simple but this isn't documented on the vendor end so seeking your help.

HAProxy Redirect URL

I am using HAProxy 1.8, I need to make redirection rules, but I do not know the tool well, I have tried but it fails me in some particular cases with different clients.
Client Applications: Adobe Flex 3 (Web) and .Net (Web, WebServices and Desktop).
Necessary redirection example:
Current URL: http://oldsite.com/WS/WSInfo/WSDataClient
URL redirection: http://web1.site.com/WS/WSInfo/WSDataClient
I must perform several redirects (so I have to repeat the rule many times), I can not redirect all "olsite.com" to "web1.site.com", since both balancers will have concurrent calls, not all services, "http://oldsite.com" will stop being used.
The rule of HAProxy:
###----SERV_WSInfo_WSDataClient_test
acl withwsdl_SERV_WSInfo_WSDataClient url /WS/WSInfo/WSDataClient_test?wsdl
acl notwsdl_SERV_WSInfo_WSDataClient path_beg /WS/WSInfo/WSDataClient_test
http-request redirect location http://web1.site.com/WS/WSInfo/WSDataClient?%[query] code 301 if withwsdl_SERV_WSInfo_WSDataClient
http-request redirect location http://web1.site.com/WS/WSInfo/WSDataClient code 301 if notwsdl_SERV_WSInfo_WSDataClient
This works in the Flex applications that consume it, but not in the .Net point, I have been able to detect that:
Flex calls WSDL twice from the service (I suspect that by the redirect of the rule), but it works.
.Net, on the other hand, never asks for the WSDL and the service returns error, blank response.
Someone can recommend how would be the correct way to implement the
rule to achieve the necessary redirection.
To redirect an HTTPS with that same URL, should I add more logic?
They think that I'm not using the necessary tool to do it, they can recommend another one (currently HAProxy is used but if I manage to make it work in another Proxy, I could ask to evaluate).
I thank you for your help since I do not use the tool and I am not from the network area.
Given they are both on different HAProxy servers makes it a bit easier as you dont need to worry about an acl for the new domain. Here is a simple acl that doesnt worry about the querystring at all.
acl is_SERV_TEST url_beg -i /WS/WSInfo/WSDataClient
This acl checks the beginning of the url (case insensitive with the -i) against our url we need to redirec the prefix (host).
http-request redirect code 301 prefix http://web1.site.com if is_SERV_TEST
The redirection simply changes the prefix and maintains the remainder of the URL. For this reason we dont need to worry about the query string etc.
Full Code
acl is_SERV_TEST url_beg -i /WS/WSInfo/WSDataClient
http-request redirect code 301 prefix http://web1.site.com if is_SERV_TEST
SSL Question
For SSL related rewrites this is a double edge sword, and this is against the requirement of the company. For example if you want all request from http://oldsite.com to go to the SSL (HTTPS) url for web1.site.com then you should be doing that in your 301 redirect.
So you would simply change the rewrite prefix to https://web1.site.com.
Finally if you also need to mange the 301 redirect for ssl (ie over port 443) you should create another listener frontend binding to :443 and use the same rules as your port :80 listener.

How ansible callbacks are configured

I have scoured the ansible documentation as well as a few books, google and the source code, but for the life of me I cannot find the answer to this simple question:
How does one change the configuration items that affect the beahavior of ansible callbacks?
-E.g: the mail callback appears, looking at the code, to be able to be configured to send mail to a configurable email address through a configurable SMTP host. How/where/when should these be specified?
TIA
Edit:
Well, OK, if the mail callback (and the base class for callbacks) are anything to go by, there appears to be NO standard configuration mechanism for callbacks. Mail gets SMTPHOST from an environment variable if it's there, and to: appears to be nailed to root.
You can change the email address to your own in the mail.py file
if sender is None:
sender='<root>'
if to is None:
to='<root>'
You can change the root to your own email address, and the each host output will be sent as an email.
Also please make sure you have whitelist the plugins in ansible.cfg file.
First you need to set the callbacks plugins directory and then also whitelist it (I am assuming that you are using Ansible 2.0+) inside the ansible.cfg:
[defaults]
callback_plugins = ./plugins/callback_plugins
callback_whitelist = name_of_your_plugin_here
Hope this will help you.
Unfortunately, you really need to look at the code for now to get the full documentation. Looks like currently the only way to configure it is by setting the SMTPHOST environment variable. The slack plugin allows configuration via either environment variables or by adding settings to the [callback_slack] section of ansible.cfg

Apigee - modify target path when using targetserver

I have an API proxy that needs to be able to modify the path component of the eventual Target URL. This appears fairly straightforward in cases where there's a defined Target Endpoint URL for the entire proxy but we are using TargetServers and VirtualHosts which apparently are assigned after the TargetEndpoint PreFlow
I have a JS function in the Target Endpoint PreFlow and get unspecified JS errors when I attempt to modify context.targetRequest.path. Attempts to modify the path part of the incoming proxy during Proxy PreFlow also failed.
Dumping the values of targetRequest gives:
host=empty
path=/v2/cat1/cat2/?param=......
url=Identical to path!
The only variable that I've been able to "successfully" modify is targetRequest.url to achieve my aim but to do that I must assign the whole thing, including the protocol and host which aren't known to me!
Anyone know how to do this? I essentially want to modify the path replacing "/?" with just "?"
Thanks
You can also set it up at the target endpoint by leveraging the Path element along with TargetServer:
<TargetEndpoint>
...
<HTTPTargetConnection>
<LoadBalancer>
<Server name="TargetServerABC"/>
</LoadBalancer>
<Path>/v1/YourPathHere/json.ws?{flow.company.queryparams}</Path>
</HTTPTargetConnection>
</TargetEndpoint>
Note TargetServerABC needs to be a TargetServer created using the following these steps.
There seems to be an issue with manipulating target.path (there is a bug report open in Apigee for this).
The current workaround is to rewrite the entire URI either in the AssignMessage policy using the AssignVariable block:
<AssignVariable>
<Name>target.url</Name>
<Value>http://example.com/mypath?param=value&variable={apigee.variable}</Value>
<Ref/>
</AssignVariable>
or you can do it in Javascript with the context.setVariable function:
context.setVariable("target.url", mycompleteurl);

WSO2 ESB - Dynamic value for proxy parameters (transport)

I need to be able to specify a dynamic value for proxy parameter. Actually, I have to specify each parameter with complete URL like :
<parameter name="transport.vfs.FileNamePattern">.*.txt</parameter>
I see some samples with property mediator and I guess it's working for next proxies but the problem here is that I need to change the proxy parameters value before its execution I think. I tried with a "trigger" proxy calling a custom mediator which change SynapseConfiguration of required proxy but this wasn't working.
Is there a way to replace these fixed value with lookups to create some deployment configuration ?
Many thanks.
You can check out this post How to dynamically route message in WSO2 ESB based on XML configuration file for an example how to dynamically set values in a proxy sequence.
You can do something this:
<parameter name="transport.vfs.FileNamePattern">
<script language="js">mc.getProperty('MY_DYNAMIC_VALUE')</script>
</parameter>
I am not sure this will help you much, as I suspect that the vfs parameters are set when initializing the proxy and not on the fly. If you give it a try, if possible please post back to this thread if it works or not.
Regards, nidkil
The Parameters in the Proxy service definitions are service level Parameters which is in the Axis2Service Configuration . They are used when you are initialing the Axis2Service in this case its the Synapse/WSO2 ESB proxy service. So you can't change the parameters dynamically on the fly.
But i can suggest following approach. It might or might not applicable to your scenario.
Have set of VFS proxies that listen for separate locations. Each will look at a give file extension. (one for .txt one for .foo etc..)
Use another generic vfs proxy to copy files to correct places dynamically(which accepts any extension).(You can use vfs sender).
Hope this helps.
cheers,
Charith

Resources