-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax for Submitting Subrequests to FastCGI #476
Comments
Making a subrequest to |
What is the syntax for that? |
Take a looks at fastcgi_pass. |
So you're saying that the same syntax applies in the subrequest method? Just confirming. I am already familiar with that syntax but was having a bit of trouble implementing. |
r.subrequest() takes as its first argument a nginx location,
|
Odd. I actually tried this exact thing. It didn't work. That is why I wrote the issue. The subrequest attempted to go to docroot/fastcgi rather than the actual fastcgi backend. |
Hi @lancedockins, I am not very familiar with fastcgi, can you please provide me with complete, but minimal example? But, from njs perspective there is no difference between locations. Only a content phase directive (proxy_pass, fastcgi_pass, ...) at the specified location decides what to do with the incoming request. |
@xeioex Just for context, I'm actually quite familiar with fastcgi_pass and related params. I've been using it successfully for years. This doesn't have anything to do with fastcgi params. That's for certain. The ONLY thing that I'm trying to do with this is pass a subrequest to a fastcgi backend. It's essentially just a replacement for doing fastcgi_pass just like you can do with subrequests as a replacement for proxy_pass. I've tried a few different methods: Using an internal location and passing the request directly to the location: Using the unix socket name Using a named location All of these ultimately fail. In every case, they are trying to go to document root/subrequest location. That sort of path is relevant for a URL. It's not relevant for a FastCGI backend. That's why I was asking about the syntax. The failures are like this: internal location: named location: unix socket: As far as I can see, NJS subrequest seems to only work for proxy. It doesn't seem to support anything other than proxy right now. |
Is there a syntax to submit subrequests to the FastCGI backend?
For example, if you want to use js_content to do some work before the content is retrieved, issue a subrequest to a FastCGI backend, and then do some work on the response (that can't be done by FastCGI and what it hands off to), then a subrequest to FastCGI would be needed to do that.
Right now, the documentation seems to imply that subrequests only work for proxy style locations. But is there a way to route the subrequest to a FastCGI backed?
I've tried using a subrequest to a named location, but that doesn't seem to work (it only works for internal redirection). Is there something that is supported like the below as a URI?
fastcgi://path/to/socket
fastcgi://ip:port
We use socket mode if that is relevant. But ultimately, I'm just looking for a way to issue a subrequest to a FastCGI backend.
The text was updated successfully, but these errors were encountered: