Serving a subdirectory

Thomas Schweikle tschweikle at gmail.com
Wed Dec 4 18:08:52 UTC 2019


Hi!

I'm a little bit lost now, since various configurations tried just dont
work. None of them.

I have:

server {
    listen 443 default_server ssl;
    listen [::]:443 default_server ssl;

    server_name nc409.my.domain;
    root /var/www;
    index index.sh index.html;

    location /chrony {
        try_files $uri $uri/ $uri/ index.sh;
    }

    location ~ "index\.sh"$ {
        gzip off;
        fastcgi_pass unix:/var/run/fcgiwrap.socket;
        include /etc/nginx/fastcgi_params;
        fastcgi_param DOCUMENT_ROOT $document_root;
        fastcgi_param SCRIPT_FILENAME $request_filename;
    }

}

With https://nc409.my.domain/ it gives an empty page (this is intended).
With https://nc409.my.domain/chrony it gives 404-not found.
With https://nc409.my.domain/chrony/ it gives 404-not found.
With https://nc409.my.domain/chrony/index.sh it gives 403 Forbidden.

If i am looking at the debug logs all seems OK: nginx feeds
/var/www/chrony/index.sh to fcgiwraper. /var/www/chrony/index.sh is allowed
to be executed by all. group is root, owner is root. Only the owner is
allowed to write the file. All others are allowed to execute it.

My first question: why doesn't nginx:
https://nc409.my.domain/chrony -> https://nc409.my.domain/chrony/index.sh
https://nc409.my.domain/chrony/ -> https://nc409.my.domain/chrony/index.sh
https://nc409.my.domain/chrony/index.sh ->
https://nc409.my.domain/chrony/index.sh
https://nc409.my.domain/chrony/index.css ->
https://nc409.my.domain/chrony/index.css

feeding index.sh to fcgiwraper and delivering index.css directly? And how
do I have to set up this thing to do exactly that?


-- 
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20191204/a8b6fe40/attachment.htm>


More information about the nginx mailing list