loadbalancing with apache2 - webserver

I have two web servers which host a web page and a load balancer. I installed apache2 and httpd in load balancer but it does not work because when I want to load the web page from a client it cannot find the web page in load balancer.

Related

Anyway to get both HTTPS and CDN in GKE?

My goal is to run multiple sites in a cluster (GKE). Here is what I'm trying to achieve:
Each site should be on HTTPS (using cert-manager and letsencrypt) with HTTP/2
Should be possible to enable Google CDN in the load balancer
Method 1:
I tried both https://www.getambassador.io/ and https://github.com/kubernetes/ingress-nginx. But both of them created TCP/UDP (layer 4) load balancer which doesn't allow CDN to be enabled
Method 2:
Later I tried default Ingress(https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer) provided by GKE (layer 7), which creates HTTP(s) load balancer instead of TCP/UDP. CDN worked in this case. But I couldn't configure cert-manager. Couldn't find any docs for that. Not sure whether this load balancer terminates SSL by default which cannot be changed. I think there is also a limit of 15 domains in load balancer for SSL
Method 1 doesn't support CDN and Method 2 doesn't support cert-manager! Could find a way to get both HTTPS and CDN
Is there any way to get this work?

Tell Wildfly to redirect to HTTPS after login instead of HTTP when behind HTTPS wildfly undertow-balancer

We have a load-balancer sitting in front of two wildfly servers. The load-balancer handles the SSL handshake and forces all traffic over https (http requests are redirected to https requests), the wildfly nodes do not have certificates on them and traffic between load balancer and servers is unencrypted, the wildfly nodes know nothing about the SSL.
When a user hits a protected page the wildfly presents them with a login page. User enters credentials and submits the login form. The wildfly logs user in and then sends a redirect to the user to send them to the desired page. The redirect sent by the wildfly is an HTTP redirect. This gets grabbed by the load-balancer and redirected to HTTPS but I really want to avoid that second redirect. How can I tell the wildfly to return HTTPS redirect after login instead of HTTP?
I followed link but not sure how to deal same between wildlfy undertow load-balancer and wildfly server.
I followed this link also but didn't get any luck.
Below is the detailed solution explanation for the above problem:
We have a load-balancer sitting in front of two wildfly servers. The load-balancer handles the SSL handshake and forces all traffic over https , the wildfly nodes do not have certificates on them and traffic between load balancer and servers is unencrypted, the wildfly nodes know nothing about the SSL.The communication between load balancer and wildfly nodes is via http protocol.
When a user hits a protected page e.g. https://someip/app
Request flow is as below:
Client browser to load balancer via https
Load balancer to wildlfy nodes via http protocol .
It worked after adding proxy-address-forwarding="true" in wildlfy server node's http
listener .

nginx redirection from webserver to API in app server, but API is running on different ports

I have two web pages are running at server IP1
Party A will be accessible via http://IP1:10009/web/example/PartyA/
and
Party B will be accessible via http://IP1:10012/web/example/PartyB/
The app server is running at IP2
Now Party A has to access the API from app server IP , with endpoint
http://IP2:10015/api/example/me
and
Party B has to access the same API , with end point
http://IP2:10018/api/example/me
Can we configure this in nginx ?
I have one webserver IP1 and app server IP2 in development environemnt, need to use nginx in demo environment

Redirect to https on GCE

I am a bit confused on how to enforce https traffic and also redirect to https. I'm using k8s, kube-lego to issue certificates and is hosted on GCE.
Is there some way to configure the GCE LBs to redirect traffic or some other solution. It is confusing, because there doesn't seem to be an easy solution for this.
Any help is appreciated. Thx.
You can create a LB for HTTPS in section Network services -> Load balancing -> Create load balancer
Choose the option HTTP(S) Load Balancing and configure it.
For example, you can create load balancer for HTTPS traffic to your frontend.
For more details on how it works, you can read in Google Cloud Documentations

Application in HTTP & HTTPS. But forms on HTTPs

I have a requirement wherein the application must be on both http and https. While the end user must be able to traverse the application in http, all forms should transition to https post submission.
Any advice as to how this can be achieved given that the application is deployed on Tomcat cluster and has a Apache HTTP Server as a load balancer distributing the load in a cluster.