Recent

Author Topic: Questions on slight difference between HTTPServer and CGI/FastCGI)  (Read 118 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1826
In most case they operate in similar way, but it seems that with CGI/FastCGI, the home url is recognized (like c:\inetpub\wwwroot), because IIS or nginx handles the webpages anyway. But HTTPServer does not seem to have such functions. So, when run with the same codes only by changing server modules (fphttpapp, fpcgi, fpfcgi + some related settings), switching between cgi and fcgi is done only changing fpcgi <-> fpfcgi (of course with related settings of IIS or nginx), but not http server.

Am I right?

If I am right, is this problem solved by using nginx to call http server by proxy-passing?

I got this solution from AI. AI suggested following setting of nginx.conf (it assumes IIS is responding to port 8080).


Quote
server {
    listen       80;
    server_name  your-domain.com;

    # Static files or main page processed by IIS
    location / {
        proxy_pass http://127.0.0.1:8080; # original IIS port
        proxy_set_header Host $host;
    }

    # Specific web requests processed by Lazarus (Horse or fpHTTP)
    location /api/ {
        proxy_pass http://127.0.0.1:9000; # Lazarus independant server port
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       
        # Protecting against time-outs (for long DB queries, etc.)
        proxy_connect_timeout       300;
        proxy_send_timeout          300;
        proxy_read_timeout          300;
        send_timeout                300;
    }
}

 

TinyPortal © 2005-2018