How configure the HTTP Headers in Weblogic Response - weblogic

Using Weblogic 11g and want to be able to add headers to all files served up by weblogic. There is no seperate web server sitting in front of weblogic. Cannot find a way to configure weblogic to add header to the HTTP response. In IIS you can easily do this by choosing the server and clicking to add headers. Looking for the equivalent way to do this in weblogic.

I dont think this is configurable. You would have to write a Filter to manipulate the headers as you need.
As a hint, you could try something along the lines of this package http://flavio.tordini.org/http-headers-filter. I have not tried this myself

If you have the option of putting Apache server in front of your Weblogic server, then you can configure Apache to do that using this. As an additional benefit, you can configure the Apache server to serve static content.
PS: Not just Apache but Lighttpd and Nginx also allow you to do that.

<url-rewriting-enabled></url-rewriting-enabled>
Can occur zero or one time.
When this flag is set to false, WebLogic will add the following header with the response Cache-control: no-cache=set-cookie so that the proxy caches do not cache the cookies.
defaults to true
http://w3processing.com/Setups.php?freepageId=19

Related

openvpn http-proxy-option headers, doing it server-side?

i'm connecting to my vpn via a proxy in order to pass some custom headers.
The way i actually do it it's by putting them in my .ovpn gonfig file, something like this:
http-proxy-option CUSTOM-HEADER Host my.host
http-proxy-option CUSTOM-HEADER User-Agent My-User-Agent
But i would like to config the proxy on the server to handle those, so if i ever need to change anything i wouldn't have to modify every configuration.
My final goal is to handle the headers on the server side of the connection in order to put only the http-proxy parameter in the .ovpn config file.
I've tried to follow a Metahackers' article on how to inject http headers with squid but it didn't work for me.
Do you have any advice or do you have resources you can point me at?
Thanks.

Apache and Nginx as reverse proxy: where to add X-Robots-Tag?

If Nginx works as reverse proxy between Apache and the web, where should i add X-Robots-Tag (to add some additional headers) - in the htaccess of Apache or in the Nginx configuration file?
You can do it in either place. Although, for a header like X-Robots-Tag, which is very much page specific then it would probably be easier to set this at the application server (in your application/CMS). Devs may not have access to the proxy server in order to apply specific headers.
Alternatively, you might choose to do this in the front-end proxy if you wanted to apply this to every request, or to a specific pattern.
But you should not apply the same header in both places, as that becomes hard to maintain (and debug).

Add custom reponse header by using tomcat config only

I have a few tomcats load balanced behind a VIP(virtualIP) and Apache is configured to talk via AJP to the tomcat VIP. There is a need to know which tomcat served the request for debugging/monitoring purposes. And so the tomcat instance that served the request should ideally send a unique response header .
However I dont see how I can achieve that without writing custom filter code to do that. Ideally I want this unique header value to reside in tomcat conf/properties folder.
Any suggestions ?

Integrating liferay tomcat with apache web server

I am trying to integrate the liferay tomcat with apache web server.I successfully integrate the liferay with web server.
Condition:
Life ray deployed on ip say : 10.10.10.70
Apache web server on ip say: 10.10.10.80
I provided all the requirement virtual host requirement in httpd.conf file..and provided the web.server.host in portal-ext.properties file.
Problem: When i run liferay portal i can open it on ip: 10.10.10.70
but when i click on any page link (let say /home)that is present in my portal it moved the request to
10.10.10.80:8080/home instead of 10.10.10.70:8080/home
I want to know how to handle this condition.
Because i dont have any page resource on web server doc folder only contain static css..
You might be a bit more precise what "all the required virtual host settings" are, e.g. what did you configure?
Note that by explicitly configuring hostnames/IP-addresses, you're explicitly overriding the autodetected settings from the request - no matter how you get to your portal, Liferay will generate URLs based on the explicitly configured hostname/port.
What's the point in having an Apache in front and then trying to reach tomcat through the non-apache IP/Port? Typically you might have static resources, rewrites, caches on Apache, so that you'll get different results when you alternatively access tomcat through both URLs.
If you configure Apache to "properly" handle the requests before tomcat sees them, you'll typically not need to configure Liferay at all, because Apache will make the actual hostname that it's requested under available to Tomcat. I'm typically using mod_jk for this and it beautifully handles all the configuration with almost no need to explicitly configure tomcat/liferay. If you don't like this, keep in mind that you're explicitly configuring Liferay for the virtual host setup - naturally this explicitly configured name is what Liferay uses. It would be weird if the explicit value would not be used, right?

Apache HTTP Filter/Logging

I am using IBM HTTP Server 6.1 / Apache 2.0.47. I would like to pull a specific piece of data out of all requests coming through the HTTP server and if it exists log the found data along with the target URL. It needs to be as efficient as possible.
Is a filter appropriate or a handler?
Does a filter/handler exist that I can configure and use as is or do I need to write something? How do I configure, or write this?
Thanks.
You could use mod_security apache module , which have a good audit log tool SecAuditLog (log all headers), that you can declench by http status. You'll find as well fine filters, that will maybe fits your needs.
And do not hesitate to ask servfault gurus on that.