Here is my problem.

I have two Intranet servers(Server1 and Server2)

and I have one application Application1 in server1 and another Application2 in Server2.

So I access both the applications in the following way.

and

Now the requirement is that I should be able to access the Application2 as follows.

without changing URL even after redirection to

Is there anyway for doing this ?

Dani AI

Generated

— the clean, robust way to keep the original browser URL while serving an app from a different host is to use a reverse proxy on the public host rather than client-side “masking” (frames). pointed to masking options; was right to flag cookies, redirects and shared-state problems that make framing brittle. A reverse proxy forwards requests server‑side and can rewrite headers and redirects so the browser never needs to know the backend host.

If the front-end webserver can act as a proxy, enable its reverse-proxy feature (Microsoft ARR/URL Rewrite for IIS, Apache mod_proxy, or an Nginx proxy). Example snippets (adjust names/paths for your setup):

# Apache (mod_proxy)
ProxyPreserveHost On
ProxyPass /app2 http://backend.internal/app2
ProxyPassReverse /app2 http://backend.internal/app2
ProxyPassReverseCookieDomain backend.internal original.internal
# Nginx
location /app2/ {
  proxy_pass http://backend.internal/app2/;
  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

Key gotchas and fixes: backend-generated absolute redirects (Location headers) must be rewritten (ProxyPassReverse or equivalent); Set-Cookie domains/paths may need rewriting; if the backend expects a particular Host header, preserve or set it; ensure HTTPS/SSL is handled at the proxy or proxied correctly; and restrict direct public access to the backend host. When an app emits absolute links in HTML, consider fixing the app to use relative links or use cautious response-body rewriting only as a last resort.

Quick troubleshooting checklist: use browser dev tools to inspect Location and Set-Cookie headers; test with curl adding a Host header to simulate the proxy; check proxy logs for 502/504 errors; and validate the proxy rewrites with a simple static page first. Microsoft, Apache and Nginx docs have step‑by‑step reverse proxy examples: see Microsoft ARR reverse proxy, Apache mod_proxy, and Nginx proxy module for implementation details.

Recommended Answers

All 3 Replies

That isn't necessarily a good idea. You can run in to problems with frames/cookies/shared application states/etc. Did you write the applications or can you integrate them on the back end? What webserver and what type of application are you dealing with?

Application1 in Server1 is using IIS and Applicatio2 in Server2 is using Apache.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.