How to configure maintenance page in Traefik v1.7.33 - azure-service-fabric

We are using Traefik V1.7.33 as Azure ServiceFabric Application, which will perform traffic redirection to the windows containers in VMSS. We need to redirect traffic to the maintenance web page when there is an container image refresh. Following TOML configuration change didn't help.
[http.middlewares]
[http.middlewares.test-errorpage.errors]
status = ["500-599"]
service = "serviceError"
query = "/{status}.html"
[frontends]
[frontends.website]
backend = "website"
[frontends.website.errors]
[frontends.website.errors.network]
status = ["500-599"]
backend = "error"
query = "/{status}.html"
[frontends.website.routes.website]
rule = "Host: website.mydomain.com"
Would like to know is there any other way to perform this.

Related

Assign Domain Name For Same IP, Different Nodeports Minikube

I'm trying to set up a local environment for microservices using minikube. My cluster consists of 4 pods and the minikube ip for all 4 of them are the same. However, each service runs on a unique nodeport.
EG: 172.42.159.12:12345 & 172.42.159.12:23456
Ingress generates them as
http://172.42.159.12:12345
http://172.42.159.12:23456
http://172.42.159.12:34567
http://172.42.159.12:45678
They all work fine when using the ip to access them, and they work fine when using a loadbalancer and deploying a cloud environment.
But I want this to work on my minikube, and I can't use the ../etc/hosts to assign domain names for each service ecause it does not accept the nodeports being passed in.
Any help on this is really appreciated.
so I found a solution for this.
The only way to do it is with a third-party app called Fiddler.
How To:
Download And Run Fiddler
Open Fiddler => Rules => Customize Rules
Scroll down to find static function OnBeforeRequest(oSession: Session)
Pass in
if (oSession.HostnameIs("your-domain.com")){
oSession.bypassGateway = true;
oSession["x-overrideHost"] = "minikube_ip:your_port";
}
Save File

websphere application server behind ingress redirects to dns:port

I am trying to run websphere behind ingress.
I have successfully configured the ingress for it and I am able to access the console.
The ip on which I am able to access the console is
https://mydomain/ibm/console/logon.jsp
Note: I have a domain , for which I created a A record.
When I login into the console ,
I am redirected to
https://mydomain:9043/ibm/console/
This page does not exist.
If I explicitly run the URL https://dns/ibm/console/login.do?action=secure. My application works fine.
Can someone tell me where is the configuration needed so that it is not redirected to dns:port?
I have created all the config following the URL:
Problem configuring websphere application server behind ingress
The request is http://hostname/ibm/console/logon.jsp and it returns http://hostname:9080/ibm/console/logon.jsp
This is causing confusion and thus we are facing an issue.
The port which our was app uses is controlled by two properties:
trusthostheaderport = true
com.ibm.ws.webcontainer.extractHostHeaderPort = true
These can be created in the WAS Admin console under:
Servers > Server Types > WebSphere application servers > [server_name] > Web Container Settings > Web container > Additional Properties > Custom Properties
Setting both of these properties with a value of "true" should force WAS to use the front-end port (from the Host header) instead of the Webcontainer port.
Note: You need to restart the service after the change ( restart in case of docker containers)
Please find the documentation here.

Traefik redirect from one host to another

We decided to move from the subdomain structure to one root domain with path prefixes, but we got many old URLs on the internet. So is there any way to add a redirect from the old URL to the new one?
For example,
We got subdomain test.example.com switched to example.com/test, I can access correctly site with the string in docker-swarm YAML file
traefik.frontend.rule: Host:example.com;PathPrefixStrip:/test
but when I'm trying to add to Traefik config redirects like:
[http.middlewares]
[http.middlewares.test-redirectregex.redirectRegex]
regex = "^https://(*).example.com/)"
replacement = "^https://example.com/${1}"
Traefik says that it doesn't know where to forward this request
If I'm trying to add:
traefik.frontend.rule: Host:test.example.com,example.com;PathPrefixStrip:/test
Traefik adds a prefix to both hosts. Is there any way to resolve this without adding a second reverse proxy?
Assuming that you are using Traefik 2.1, you can use the below middleware for Traefik
[http.middlewares]
[http.middlewares.blog-redirect.redirectRegex]
regex = "^(https?://)(.*).example.com/(.*)$"
replacement = "${1}example.com/${2}/${3}"
permanent = true
The important step to activate the above middleware is to add the below label on the corresponding router and service. For instance, if you a a blog service and you defined a blog router for it, then you need to add the below table to the services
traefik.http.routers.blog.middlewares=blog-redirect
In addition, your route rule should look like the below rule to be able to handle both domains (or you define multiple routes per service)
- traefik.http.routers.blog.rule=Host(`example.com`) && Path(`/test`) || Host(`api.example.com``)
in this post, you can find more info about traffic and redirection

What needs to be added to webea.config.ini EA Pro Cloud file to access database over browser?

I have setup an EA pro cloud server and its successfully connected from the client side. The connection to the data base server is also established via client. Now i want to access the content of the database over the the cloud via browser and for that i have to make changes to webea.config on the cloud server. The webea.config has lots of properties, actually i have no idea what all to add against those fields for accessing the database over the browser. Following is the webea_config.ini:
model1 = "Pro Cloud "
model2 = "Pro Cloud2"
[model1 : settings]
sscs_protocol = "http"
sscs_server = "localhost"
sscs_port = "804"
sscs_db_alias = "MY_SERVER"
auth_code = ""
login_prompt = "false"
default_diagram = ""
show_discuss = "false"
On the browser i see as :
But when i click on pro cloud it does not take me to the database contents.
Can anyone please explain me what all do i need to add webea_config.ini file So that i get to the contents inside the database.
maybe localhost isn't known from outside, did you try providing a IP address?
Also i'd first test the same connection in 'Connect to Cloud' option in EA (from the machine where I'm trying to access from browser).
Also please ensure you have set the license and other settings required for PCS to work, refer to https://prolaborate.com/resources/documentation/installation-guide?articles=SetupProCloudServer to double check all configs are in place.

Grafana datasources connection using proxy

How Grafana can be configured to connect to the data sources (for example Graphite) via proxy?
Grafana -> Proxy -> Graphite
When adding Graphite data source in Grafana there is an option to choose access with proxy (Proxy=Grafana backend will proxy the request) but there is no place in the configureation.ini to specify the IP of the proxy to be used for backend data transfer.
In the ini file there is location to specify "authentication proxy" for accessing the Grafana UI but can this be used for proxy between Grafana and Graphite?
[auth.proxy]
enabled = true
header_name = X-WEBAUTH-USER
header_property = username
auto_sign_up = true
Where the proxy details between Grafana and its data sources can be configured?
Thanks for the reply of AussieDan
I have added the environment variables :
set HTTP_PROXY="http://proxy_IP:proxy_port"
set HTTPS_PROXY="https://proxy_IP:proxy_port"
And started the Grafana in same command prompt .
When trying to save the Graphite data source in Grafana UI, it says in the log "proxy error: Service Unavailable". Telnet to the proxy on same port works fine so the port is open.
` 2016/12/13 15:55:05 http: proxy error: Service Unavailable ←[31mEROR←[0m[12-13|15:55:05] Request Completed ←[31mlogger←[0m=context ←[31muserId←[0m=1 ←[31morgId←[0m=1 ←[31muname←[0m=admin ←[31mmethod←[0m=GET ←[31mpath←[0m=/metrics/find ←[31mstatus←[0m=500 ←[31mremote_addr←[0m=IP ←[31mtime_ns←[0m=15ns ←[31msize←[0m=0 `
Is there anything additional that needs to be configured for proxy communication?
Grafana defines a new user named grafana with its own environment, as stated here under Start the server (init.d service) and Environment file sections.
The environment file on ubuntu is located in /etc/default/grafana-server
Paste your proxy environment variable definitions in this file as so:
https_proxy=http://<ip>:<port>/
http_proxy=http://<ip>:<port>/
no_proxy=localhost,127.0.0.0/8,::1,<other ip/networks to ignore>
Since the grafana backend is written in go, you can use the HTTP_PROXY="http://proxyIp:proxyPort" environment variable to specify a proxy for it to use for all outgoing requests.