Thank you Roberto.

I am dealing with a legacy system which apparently lacks serveral
fastcgi_param. It's written in Java fcgi so it's kinda different from nginx.


I gradually figured it out, in case anyone else have the same problem like
me, you can force add CGI parameters/variables like this:

$ uwsgi --workers 2 --fastcgi-socket :9000 --module server:app --route-run
"addvar:SERVER_NAME=localhost" --route run "addvar:SERVER_PORT=9000"
--route-if "empty:$(REQUEST_METHOD) addvar:REQUEST_METHOD=GET"

uWSGI is very powerful!


On Wed, Jan 4, 2017 at 4:38 PM, Roberto De Ioris <[email protected]> wrote:

>
> >> From this example and the previous one you posted it
> >
> > OK let's forget about my previous examples, lets focus on how to use
> > internal router to print "hello" to console when a fastcgi request
> > arrives.
> >
> >
> >> You can instruct the fastcgi parser to force a specific modifier with
> > --fastcgi-modifier1 <n> (where n is the modifier1)
> >
> > It still doesn't work
> >
> > Let's compare
> > uwsgi --workers 2 --http-socket :8080 --route ".* log:hello"
> > --http-modifier1 5
> > uwsgi --workers 2 --fastcgi-socket :9000 --route ".* log:hello"
> > --fastcgi-modifier 5
> >
> > The only difference is http vs fastcgi.
> >
> > However, the first --http-socket displays "hello" to console, which is
> > expected.
> > The second --fastcgi-socket displays
> >
> > -- unavailable modifier requested: 5 --
> >
> >
>
>
> This is because very probably your fastcgi client is not setting PATH_INFO
> that is the variable checked by --route. Instead --route-uri checks
> REQUEST_URI (in case your client sets it).
>
> By the way if you blindly want to catch anything in your rules, just use
> --route-run <action:args>:
>
> /uwsgi --fastcgi-socket :8080 --route-run "send:Hello World" --route-run
> "break:"
>
> The "break" rule will block uWSGI from passing the request to the plugin
> handler (that is what generates the unavailable modifier requested error)
>
> --
> Roberto De Ioris
> http://unbit.com
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to