Nginx reverse proxy for drools business central workbench - drools

Issue in nginx reverse proxy for drools business central workbench. It is working fine till login page but after login it just shows loading gif which says please wait loding application.

THis is an issue with websocket, errai (the technology used by Drools) and nginx.
This configuration usually solves for me:
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
Source: https://groups.google.com/g/drools-setup/c/86XzRYrvRcY

Related

How to enable CORS in a self-hosted maptiler-server?

I want to configure Access-Control-Allow-Origin of a server machine running maptiler-server
but cannot find any documentation how to do it. I also want to know if there is any way to provide the maptiler-serve with access tokens generated by another web server to implement some sort of access control. I don't want the map server to be accessible by everyone. I want to restrict it to the users of a particular web application.
I found the solution on maptiler's page. Basicly I had to install a reverse proxy that did redirect to the maptiler-server. The example on their page uses Nginx as reverse-proxy server. To configure it in order to add Access-Control-Allow-Origin header on each responses, I had to extend the example with two more lines. So my location block inside configuration file looks like this:
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_pass http://127.0.0.1:3650;
proxy_hide_header 'Access-Control-Allow-Origin';
add_header 'Access-Control-Allow-Origin' '*' always;
}
The default configuration is located here /etc/nginx/sites-available/ or here /etc/nginx/conf.d/

302 redirect doesn't work behind nginx reverse proxy

We are currently switching from Pound to Nginx for our reverse proxy, I have everything working except for one site.
We have a split DNS setup. All of our webservers are behind our firewall. If you are on our network our internal DNS points directly to our webservers. If you are outside our network our external DNS points to our reverse proxy, which forwards traffic through our firewall to the webservers.
We have one site which is of course vendor software (horray!) basically if our users go to http://abc.foo.com the server sends a 302 redirect code and point them to https://login.vendorsite.com
This redirect works on the inside, but if you connect from the outside the 302 redirect never makes it thorugh nginx. They stay on abc.foo.com and instead a 200 status is returned by Nginx.
We never had this issue with Pound, pound allows the redirect through with no issue.
Here is my current config for nginx:
server {
listen 80;
server_name abc.foo.com;
location / {
proxy_set_header Host &host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://webserveripaddress;
}
}
I guess you're missing something, but if it really that simple you just can use return
location / {
return 301 http://webserveripaddress;
}
Apparently we are no longer using the internal server for abc.foo.com
They changed the DNS entry on the external DNS and never removed the information from the old reverse proxy since "it didn't go there anymore anyway".
So Nginx is working as it should.

How to distribute microservices through nginx?

I am new to microservices architecture and I have three REST services which was in a monothlithic architecture which I converted into three micro services (seperate DB and stuff) which have their own embedded web server (Spring boot fat jar) . Initially I had to serve the API through a reverse proxy so I map all the path (doamin:8080/application01) to something like this.
location /application01 {
proxy_pass http://username.github.io/project;
proxy_redirect http://username.github.io http://a.b;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
}
But now I had to it three times since all my microservices are having three different ports.I am reading about API gateway.But if I implement that wouldn't it be a single point failure.If then what is the diffence between a monothlithic and which i am implementing right now.Any help is appreciated.

Logged into database 'yadi', but dbfilter rejects it; logging session out

Good morning,
I'm working on odoo 8, I created a new database 'yadi' but nothing happens, I always get database manager web page, and this is error on open-server.log:
Logged into database 'yadi', but dbfilter rejects it; logging session out.
Thank you for your help.
I am ODOO expert, It seems issue with nginx or apache2 configuration.
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host $host;
This header required in all proxy location. only / for this location not enough. All location with proxy_pass entry you need to add.
Even do for /web/static/ or website/static/ etc...
As ODOO multi host configured with dbfileter ^%h$, indicate all database based on host, so right header to forward.
In case you test without dbfilter, all works well but with dbfilter this may arise an issue.
Now follow my instruction, sure it will resolve ODOO bugs concerns.
You need to remove db-filter from openerp-server.conf
For search mention, you need to use following command.
locate openerp-server.conf
Go to path and remove db-filter parameter.
Generally, that file located under /etc/ folder.
Afterwards, reboot your system.

How to serve static files (images etc.) for a PSGI / Plack web app (in Perl)?

How to serve static files (images, javascript, stylesheets) for a PSGI / Plack based web app?
The answer would probably depend on what web server one uses, be it CGI, FastCGI, mod_psgi, or pure-Perl like Starman. I have heard that using Plack::Middleware::Static or Plack::App::File (together with Plack::App::URLMap) is to be used only for development...
As far as live deployment goes, a very uncomplicated (and fast) setup is if you let the web server deal with the static content and let the Plack app deal with the dynamic content. That would generally require at least 2 proxies in your web server config. Proxy A to your static files (assuming they're all generally in the same place) and proxy B to the port which your Plack app is deployed on.
For example, part of an nginx config might look like the following. Assume that the Plack app is running on port 5001 locally and that your static files are available under the url http://mydomainname.com/static
server {
listen 80;
server_name mydomainname.com;
location / {
proxy_pass http://localhost:5001/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;
}
location /static {
root /path/to/static/files;
}
}