Recent

Author Topic: I can't get NGINX fastcgi_param inside FPWeb handler  (Read 2481 times)

alantelles

  • New Member
  • *
  • Posts: 21
I can't get NGINX fastcgi_param inside FPWeb handler
« on: January 06, 2021, 09:30:56 pm »
Good afternoon. I'm trying to get a way to obtain the fastcgi_param definitons from NGINX inside my app. Neither some of the most basic parameters are passed, such as ARequest.URI or ARequest.URL. I've already tried to get it in Application.EnvironmentVariable but with no success.

My configurations are like suggested by NGINX documentation for PHP FasctCGI or FPM.

Does someone have been succeeded on this?

PS.: Use other web framework is a possibility, however I'd like to stay with FPWeb if possible.
# compulsive coder
FPC 3.2.0, Lazarus 2.0.10

Renat.Su

  • Sr. Member
  • ****
  • Posts: 253
    • Renat.Su
Re: I can't get NGINX fastcgi_param inside FPWeb handler
« Reply #1 on: January 06, 2021, 09:48:20 pm »
I get the request parameters without problems. True I use BrookFreePascal.

P.S. I used fast-cgi mode, but then switched to the embedded web server mode, which works on a certain port, and then is proxied by NGINX to standard. ِAlso You can tune up SSL for HTTPS. The convenience is also that you can configure nginx to take full care of static files

alantelles

  • New Member
  • *
  • Posts: 21
Re: I can't get NGINX fastcgi_param inside FPWeb handler
« Reply #2 on: January 06, 2021, 10:09:06 pm »
According to your experience, is there some great performance loos while proxying NGINX through FCGI or through Embedded Server in FPWeb? And with BrookFreePascal?

Also, could you send some very basic example of handling requests with brook FCGI? I found some on github but for cgi instead.

thanks for answer
# compulsive coder
FPC 3.2.0, Lazarus 2.0.10

Renat.Su

  • Sr. Member
  • ****
  • Posts: 253
    • Renat.Su
Re: I can't get NGINX fastcgi_param inside FPWeb handler
« Reply #3 on: January 06, 2021, 11:16:14 pm »
According to your experience, is there some great performance loos while proxying NGINX through FCGI or through Embedded Server in FPWeb? And with BrookFreePascal?
I can't compare. Both modes I did with brookfreepascal
Also, could you send some very basic example of handling requests with brook FCGI? I found some on github but for cgi instead.

thanks for answer
You just create the app using the wizard. In Uses, a broker for FastCGI operation is added. Otherwise, all work in Brook is similar, whether it's CGI/Fast CGI or even on a web server. To work with request parameters, you can use the HttpRequest object property of the TBrookAction class

Renat.Su

  • Sr. Member
  • ****
  • Posts: 253
    • Renat.Su

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2032
  • Former Delphi 1-7, 10.2 user
Re: I can't get NGINX fastcgi_param inside FPWeb handler
« Reply #5 on: January 07, 2021, 01:28:20 am »
True I use BrookFreePascal.

What an unfortunate name - I had ignored it completely previously because it sounded like it was a fork of Free Pascal. I notice it is referred to elsewhere as "Brook for Free Pascal" or "Brook Framework", better but still not obvious from the name what it is/does. Such a shame because it looks really useful.

Renat.Su

  • Sr. Member
  • ****
  • Posts: 253
    • Renat.Su
Re: I can't get NGINX fastcgi_param inside FPWeb handler
« Reply #6 on: January 07, 2021, 08:49:05 am »
Meant BrookForFreepascal. The first development branch of brookframework up to and including version 4.0, which only works for FreePascal. The new brookframework, which was given this name, supports both Delphi and FreePascal, but I like it less and has dependencies on the libsagui micro http server. The remaining branch changed its name to brook4freepascal so

alantelles

  • New Member
  • *
  • Posts: 21
# compulsive coder
FPC 3.2.0, Lazarus 2.0.10

 

TinyPortal © 2005-2018