#1 2015-08-25 21:00:02

sushi
Member
Registered: 2012-05-04
Posts: 3

Nginx and mormot Rest Server

Hi,

I want to host 2 services, a mORMOT server and a blog in Java on my rapsberry pi 2 server. (Yes, the REST Server works! Awesome!)
To do this, i use nginx to redirect request:
   http://localhost/  => redirect to localhost:9000 (java app)
   http://localhost/app => redirect to localhost:8080 mormot REST Server

So i set up nginx to redirect request with proxy_pass (see config below). The redirection works when i access with my browser to http://localhost:8080/root/index, i see my page. But when I access to http://localhost/root/index, it takes 5 second to show the page. It seems, that it's Nginx which take time to redirect the url. Here the nginx config I use.
Does someone know how to redirect mormot url with nginx?

Thanks.

worker_processes  4;

events {
  multi_accept                    on;
  worker_connections              5120;
  use                             epoll;
}

http {
  charset                         utf-8;

  server {
    listen       80;
    server_name localhost;

    location / {
       proxy_pass http://127.0.0.1:8080;
       proxy_buffering off;
    }
  }
}

Offline

#2 2015-08-26 08:27:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Nginx and mormot Rest Server

I do not know...
Did you try to ask on the NGINX support?

Offline

#3 2015-08-26 15:17:19

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 357

Re: Nginx and mormot Rest Server

With apache there is no such a time lag, but there is also a reverse-proxy line.
I can only say it is not a mORMot problem, but I don't know how to configure ngnix.

Offline

#4 2015-08-26 15:35:29

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Nginx and mormot Rest Server

Perhaps some kind of "optimization" of nginx, which wait for the connection to be closed before sending the content.
There may be some additional option to disable such a timeout.

Offline

#5 2015-08-28 02:16:49

wenli0202
Member
Registered: 2015-08-20
Posts: 3

Re: Nginx and mormot Rest Server

Hi sushi ,
I try nginx in win7  had some delay problem when TSQLHttpServerOptions set  useHttpSocket or useBidirSocket ,
but set useHttpApi or useHttpApiRegisteringURI is ok.

Offline

Board footer

Powered by FluxBB