IIS Reverse Proxy on top site - reverse-proxy

I have a site (ex: a.domain.com) with multiple applications inside (ex: a.domain.com/App1, a.domain.com/AppX).
I need to figure out how to do a reverse proxy on the top site, only when the people try to access a.domain.com. If someone wants to access a.domain.com/App1 the reverse proxy will have no effect.
Thanks in advance!

May I know how did you set the reverse proxy?
In IIS, we usually use URL rewrite rule to build the reverse proxy.
If you only require reverse proxy rule only take effect on the root www.doamin.com. Then you should add an <add input="{URL}" pattern="^(/)?$" />condition pattern in your rule or include all folder/URL under the top site. Otherwise you have to use regex expression to exclude all 288 applications manually. IIS won't be able to detect sub-application collection and add them to URL rewrite rule automatically.

Related

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).

Correct Apache Configuration And Htaccess

I've just reset my Ubuntu 14.04 LAMP server hosted with digital ocean. Could someone tell me the 'proper' way to do server configuration. My goal is to do everything as clean as possible (and hopefully well structured).
I intend on using the server mainly for programming and data analytics, however I do plan on hosting my website in /var/www/html. I also plan on using letsencrypt/certbot to get an easy SSL. With this in mind, these are the main goals I would like to accomplish:
1) Redirect the website to ALWAYS be served through https AND www.
2) Enable HSTS for the entire website.
3) Enable clean url's (remove .php extensions and what not).
Since I would like all of these properties to be used across the entire website, should the configuration be done inside of the /etc/apache2/ folder? Or should it be done inside of .htaccess?
And if it should be done inside of apache2 configuration, which file should I add it to? And finally, how exactly should it be added? (for example vhost 80/443, inside of a mod_something section, etc).
Thank you in advance, I would appreciate and consider any advice about Apache and htaccess!

Apache like Rewrite Rules in Openshift

I have configured Jboss7 on Openshift yesterday. All I need to have an internal rewrite rule to have /members.html -> members.jsp.
This requires user to see members.html while the actual file(members.jsp) is served by Jboss itself.
Dont know correctly how to setup mod_jk if required but surely I would like this thing to work anyways as I have urls submitted in google and shifting site on openshift should not require me to change the URLs.
I don't think you have access to the Apache configuration on the server. You would need root permissions for that. Have you considered an alternative approach via a web application filter. There is UrlRewriteFilter - http://tuckey.org/urlrewrite/ - which might solve your problem.

How to rewrite URL in Tomcat 6

I'll build a web application and I want to use url rewriting.
In apache this is done with mod_rewrite.
But how can I rewrite urls with Tomcat 6?
I want to use Struts 2 framework.
I've used UrlRewriteFilter as a critical component of a couple of my tomcat-based apps, and have been totally happy with it.
You can do wildcard mappings in your struts.xml:
<action name="*Crud" class="example.Crud" method="{1}">
...
Then I think you can set your default action extension to / in struts.properties:
struts.action.extension=/
As for the URL filter, here's a good blog post.
It could be a good idea to have Apache as a web server for static content in front of Tomcat application server.
You can then use Apache's mod_rewrite and Tomcat.
In any case, there's a similar question.

What is the best technique for (seo-friendly) forwarding muliple domains to one web server?

The setup is:
www.domainA.com
www.domainB.com
both actually hosted on one web server (Apache)
123.123.123.123/domainA
123.123.123.123/domainB
I have setup a hidden forward from the domains to the web server directories which works fine, however, produces duplicate content (since it is also available by addressing the web server directly). I tried setting up 301 redirects to the domains for every request that is targeting the IP address directly (using mod_rewrite),but found that this results in a forwarding loop. Obviously the server does not recognize whether the domain has been requested originally.
If anybody can give me a hint on how this is supposed to be done, I'd be glad to hear.
You can set up virtual hosting on the web-server so that it does pay attention to the hostname that was requested. This is a fairly common practice and should solve your problem. You can do away with separate subdirectories since each virtual host has its own virtual root.
So are you saying that you have pages indexed in google that reference your IP address and a directory rather than the domain name?
Also, I'm not sure why doing a redirect from the IP to the domain name would cause a redirect loop. If the redirect is based on the host header, it should work fine.