Guten Tag
luca.v...@grammelot.eu,
am Donnerstag, 20. Juni 2019 um 09:13 schrieben Sie:
> Hi, I've setup my server so that is server both node.js and
> bugzilla on port 8080 with nginx reverse proxy.
Are sure about that? As I understand your config, only the domain
itself and hence Node.js is forwarded to :8080, which makes sense,
because Bugzilla doesn't have a listening server. Additionally, both
apps listening on the same localhost:8080 doesn't make much sense as
well. How would both be distinguished from each other?
> Everything works fine, except the bugzilla rest api (e.g
>
http://example.com/rest.cgi/bug). I always get 403 forobidden and on server log, the following error:
Forbidden make sense because your location-block enabling FastCGI
simply doesn't match your URL. That block requires to end with ".cgi",
which is not the case for your requests.
> [error] 9049#9049: *83 FastCGI sent in stderr: "Cannot get script
> name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and
> is the script executable?" while reading response header from
> upstream, client: 93.36.171.43, server: _, request: "GET
> /bugzilla/rest.cgi/bug HTTP/1.1", upstream:
> "fastcgi://unix:/var/run/fcgiwrap.socket:", host: "
factory.quiddis.com"
Not sure where those messages come from, but with my very limited
knowledge about nginx I suspect(!) that by default you have miltiple
FastCGI-servers running. The one you explicitly configure with your
last location-block, but which is not used in my opinion because of
the wrong URL, and maybe some other one because of the
fastcgi_*-configs outside of that location block and that one might be
used for some requests.
How sure are you that 403 FORBIDDEN and the error messages from
FastCGI are really related to your request toe Bugzilla's REST-API? It
might be that both are not related, but instead you get a 403
FORBIDDEN and the error messages from FastCGI come from implicit
requests of some web client to things like favicon.ico or stuff like
that.
> location ~ ^.*\.cgi$ {
> include /etc/nginx/fastcgi_params;
> fastcgi_pass unix:/var/run/fcgiwrap.socket;
> fastcgi_index index.cgi;
> fastcgi_param SCRIPT_FILENAME
> /$document_root/$fastcgi_script_name;
> }
Simply comment that location for test purposes and don't use FastCGI
first. It only improves performance, which you don't need to care
until things work at all.
Besides that, in my opinion that block doesn't match your REST-request
at all, because those end with ".cgi". I don't think the problem is
with splitting anything by nginx. Instead, the regular expression for
the location itself needs to be changed to something like the
following:
> location ~ ^.*\.cgi.*$
> location ~ ^.*\.cgi(?:/.+)?$
The second one seems more correct, but not sure if reg exp-engine of
nginx supports that.
Mit freundlichen Grüßen,
Thorsten Schöning
--
Thorsten Schöning E-Mail: Thorsten....@AM-SoFT.de
AM-SoFT IT-Systeme
http://www.AM-SoFT.de/
Telefon...........05151- 9468- 55
Fax...............05151- 9468- 88
Mobil..............0178-8 9468- 04
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow