Dynamic proxy_pass to $var with nginx 1.0

I’ve recently stumbled upon this need myself and have found that in order to use variables in a proxy_pass destination you need to set a resolver as your error.log would most probably contain something like no resolver defined to resolve … The solution in my case was to setup the following using a local DNS … Read more

Set up an HTTP proxy to insert a header

I do something like this in my development environment by configuring Apache on port 80 as a proxy for my application server on port 8080, with the following Apache config: NameVirtualHost * <VirtualHost *> <Proxy http://127.0.0.1:8080/*> Allow from all </Proxy> <LocationMatch “/myapp”> ProxyPass http://127.0.0.1:8080/myapp ProxyPassReverse http://127.0.0.1:8080/myapp Header add myheader “myvalue” RequestHeader set myheader “myvalue” </LocationMatch> … Read more

Using RestTemplate, how to send the request to a proxy first so I can use my junits with JMeter?

@AHungerArtist’s answer works for simple use cases, where you want all requests to use the same proxy. If you need some requests through restTemplate to use the proxy, and others to not, though, you may find this more useful. (Or if you just like doing it programmatically more than you like mucking with system properties!) … Read more

Apache reverse proxy with basic authentication

You can follow the instructions here: Authentication, Authorization and Access Control. The main difference for your reverse proxy is that you’ll want to put the auth stuff inside a Location block, even though the docs say that they’re only allowed in Directory blocks: <Location /> AuthType Basic … </Location> Outside the Location block you can … Read more

Is it possible to specify proxy credentials in your web.config?

Yes, it is possible to specify your own credentials without modifying the current code. It requires a small piece of code from your part though. Create an assembly called SomeAssembly.dll with this class : namespace SomeNameSpace { public class MyProxy : IWebProxy { public ICredentials Credentials { get { return new NetworkCredential(“user”, “password”); } //or … Read more

Proxy Error 502 : The proxy server received an invalid response from an upstream server

The HTTP 502 “Bad Gateway” response is generated when Apache web server does not receive a valid HTTP response from the upstream server, which in this case is your Tomcat web application. Some reasons why this might happen: Tomcat may have crashed The web application did not respond in time and the request from Apache … Read more

How should I set the default proxy to use default credentials?

For those who, unlike Brian Genisio, are able to set the contents of their application’s config file:- don’t do anything in code. Instead add this to your app.config / web.config. <system.net> <defaultProxy useDefaultCredentials=”true” /> </system.net> Really and truly the default for using the default credentials should be “true”; I’ve seen this issue confuse so many … Read more

Maven plugin not using Eclipse’s proxy settings

Maven plugin uses a settings file where the configuration can be set. Its path is available in Eclipse at Window|Preferences|Maven|User Settings. If the file doesn’t exist, create it and put on something like this: <settings xmlns=”http://maven.apache.org/SETTINGS/1.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd”> <localRepository/> <interactiveMode/> <usePluginRegistry/> <offline/> <pluginGroups/> <servers/> <mirrors/> <proxies> <proxy> <id>myproxy</id> <active>true</active> <protocol>http</protocol> <host>192.168.1.100</host> <port>6666</port> <username></username> <password></password> … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)