0

I have my site which URL is like this: https://test.my.webpage.example

And I need to block a URL similar to: https://test.my.webpage.example/weblogic/someApp/someService

This is for a application in Java, over a WebSphere, that must communicate to a WebLogic. The webserver is behind a firewall on the DMZ. The appserver is on the GRN, as well as the server that has the weblogic.

When any person hit that URL, the expectation is to receive a default error page.

Stese
  • 274
  • 1
  • 11
DevMouse
  • 11
  • 1

3 Answers3

1

If you're using the WebSphere WebServer Plug-in, you can stop it from being proxied which should result in a webserver 404:

SetEnvIf REQUEST_URI ^/+weblogic/+someApp/+someService$ skipwas=1

Otherwise, if you use mod_proxy, one simple way to return a 404 is with mod_rewrite, in the virtual host or base server config handling the hostname:

RewriteEngine ON
RewriteRule ^/+weblogic/+someApp/+someService - [R=404]
covener
  • 1,665
  • 9
  • 15
1

Well, finally did it with a change on httpd.conf, something like:

LoadModule weblogic_module /apps/web-apps/cncboltestenv2/cncboltestenv2_Runtime/testenv2_someapp/conf/lib/mod_wl.so

<IfModule mod_weblogic.c>
        <Location /weblogic/instancia/>
                SecureProxy ON
                WebLogicCluster server01u:80443,server02u:80443
                WLSSLWallet /apps/web-apps/cncboltestenv2/cncboltestenv2_Runtime/testenv2_someapp/keys/Wallet
                DynamicServerList OFF
                pathtrim /weblogic
                SetHandler weblogic-handler
        </Location>
</IfModule>
DevMouse
  • 11
  • 1
0

You can use .htaccess to block access to a URL.

Sample 301 redirect Websphere

If you use .htaccess to block the URL:

RewriteEngine On
RewriteRule (^|/)weblogic/someApp/someService(/|$) - [F]

.htaccess sample

TRiG
  • 1,167
  • 2
  • 13
  • 30