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
not able to mount applications in sub directories, but only sometimes #263
Comments
SCGI is variable based while HTTP is header based. Albeit both translates to the internal uwsgi format, handling SCRIPT_NAME accordingly is basically impossibile. I suppose your SCGI client is setting SCRIPT_NAME to /, so while in HTTP mode the "" app is searched, in SCGI mode it will search for "/". A good way to check it (without rebuilding in DEBUG mode) is adding this internal route: route-run = log:SCRIPT_NAME=${SCRIPT_NAME} to the uWSGI config. You can bypass the problem forcing uWSGI to rewrite the SCRIPT_NAME with manage-script-name = true or to completely ignore it with ignore-script-name = true Another approach would be introducing the default application concept in the psgi plugin. In the python and mono plugins the first loaded app is the default one. So unmatched SCRIPT_NAME/UWSGI_APPID fallback to it |
Here is the output from HTTP, then SCGI, with the "mount" option enabled:
With the "mount" option, setting "manage-script-name = true" didn't change anything and setting "ignore-script-name = true" made it so that neither worked. :) I suppose I should probably just choose either SCGI or HTTP and not both but I figured it would be nice to be able to debug without having to put Apache in front of uWSGI. However, there is still the problem that with "mount", HTTP does not work with PSGI. And with "psgi=foo", SCGI does not work with PSGI. (The opposite of how it was with #242.) And that's with independently of each other. |
The problem is that SCRIPT_NAME is different with the two approaches. Both should be empty (as suggested by CGI) but apache forces it to /. This is the main problem, for uWSGI/PSGI they are 2 different application. You can make this trick to force it to /: --route-if = empty:${SCRIPT_NAME} setapp:/ basically it tells uWSGI to use the app mounted under / when the SCRIPT_NAME is empty By the way i think i will add the default app concept to the psgi plugin later today, it is not obviously a fix but would mask the problem pretty well for single apps |
Now that "route-if" option did the trick. Just set the path to whatever my "mount" option is and everything works the way I expect it to. Thanks! Hopefully this will migrate to the documentation at some point. :) |
support for default app (only if the mountpoint is empty or /) has been added |
In single APP environment all works fine
But when trying to prepare to multiple apps
reloading server is OK
but first request cause
Trying two different configurations:
And second:
Gives same result:
|
Can you remove double quotes ? They will be included in the mountpoint |
cause wrong:
And ugly config make all FINE!
Notice UGLY loged message also
Now, vars looks good (y)
So, Thank you PS. Can you route interface to a common denominator? |
So if i followed all well, the "/" mountpoint is not honoured as empty SCRIPT_NAME, right ? |
right |
Ok, i was able to reproduce it, i'll push a fix in the next few minutes. Thanks again |
This is related to this ticket, sort of: #242
Here's my PSGI file:
Here is my INI file:
Here is how I am starting uWSGI:
Here is the log from starting uWSGI:
Here is the log from the vassal:
Seems all really standard. The root path of this server should respond to my PSGI script. When I connect via HTTP, everything works as expected. When I connect via PSGI, however, I get this error:
If I change the configuration from this:
To this:
Then when I connect via HTTP, I get this error:
But when I connect via SCGI, now it works.
To summarize: when I use "index=psgi" it works with HTTP but not SCGI. When I use "mount=/=index.psgi" it works via SCGI but not HTTP.
The text was updated successfully, but these errors were encountered: