Recent

Author Topic: Anybody used nginx for Windows?  (Read 4648 times)

PierceNg

  • Sr. Member
  • ****
  • Posts: 362
    • SamadhiWeb
Re: Anybody used nginx for Windows?
« Reply #15 on: October 05, 2021, 02:51:15 am »
I'm stuck ...
I tried the @egsuh example here in my computer whit ubuntu...

Why not just use the fpweb's HTTP server to do development and testing? You could even deploy the pure Pascal solution into production if your threat model is ok with that. Otherwise, HTTP reverse proxying thru Nginx and Apache is easy to configure.

egsuh

  • Hero Member
  • *****
  • Posts: 1218
Re: Anybody used nginx for Windows?
« Reply #16 on: October 05, 2021, 05:59:55 am »
Quote
sudo spawn-fcgi -a127.0.0.1 -p9100 /var/www/http/test/test

I think you should not do this, because FPC FastCGI programs will auto-spawn.  In the following page,

https://www.nginx.com/resources/wiki/start/topics/examples/fastcgiexample/

there are explanation :

Quote
Unlike Apache or Lighttpd, NGINX does not automatically spawn FCGI processes. You must start them separately. In fact, FCGI is a lot like proxying. There’s a few ways to start FCGI programs, but luckily PHP5 will auto-spawn as many as you set in the PHP_FCGI_CHILDREN environment variable. So we simply run php -b 127.0.0.1:9000 manually, or create an init script like so:

And your test.exe would be the same as PHP5.  So you may run it manually.  I configured both nginx and my fcgi app to automatically start as Windows service, and have no problem in using the webserver.

Well, problem is nginx does not support CGI directly. They say they are providing FCGI Wrapper for Ubuntu and Debian (not Windows) --- which I think runs CGI program as if FastCGI.


PascalDragon

  • Hero Member
  • *****
  • Posts: 5277
  • Compiler Developer
Re: Anybody used nginx for Windows?
« Reply #17 on: October 05, 2021, 08:58:18 am »
Sarah, in that case canonical paths *should* work. I will write a little test.

I looked at the code and I know that drive absolute and relative paths don't work, because I had already complained about that to MvC when he fixed it from previously only working with relative paths (where drive absolute paths did work however as I used them as a workaround).


nicanor

  • New Member
  • *
  • Posts: 17
Re: Anybody used nginx for Windows?
« Reply #18 on: October 06, 2021, 01:49:02 am »
Hey @egsuh... It works!!!!
Thank you very much!
Is a great sensation to live the mark zero!

I was not understanding the dynamics involved in "running the application".... Well, nothing like turn few nights studying, researching... googling... I ended up learning and understanding some things these days... So I went back to this topic and read again all the messages, this time paying more attention, so I connected the dots, (I was even a little embarrassed by the content of my previous post, i was even very raw! :)... finally i think i understood what means "stand alone" execution... and went opening my eyes. I also found this tool called "supervisor" that can be used in linux to load the FCGI application into a process and manage it... ("supervisor" can auto-spawn FCGI application when nginx receives the request...) ... But with your answers i was able to solve final details and put this test application to works!

Thanks to @PierceNg too ...
Thank you all

matthius

  • Full Member
  • ***
  • Posts: 150
  • Creating VRAD...
    • LIBERLOG - Développement rapide
Re: Anybody used nginx for Windows?
« Reply #19 on: September 15, 2023, 09:22:09 am »
I am trying to run fastcgi on nginx.

I used the config shown here.

It cannot connect to anything. Server writes connection refused.

I use GNU Linux Mint 21.
« Last Edit: September 15, 2023, 09:30:05 am by matthius »
M. GIROUX
13 rue Tanguy PRIGENT
35000 RENNES - France
(33)(0)2 23 46 06 54
http://liberlog.fr

 

TinyPortal © 2005-2018