Serving a subdirectory

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


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;

    root /var/www;
    index index.html;

    location /chrony {
        try_files $uri $uri/ $uri/;

    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 it gives an empty page (this is intended).
With it gives 404-not found.
With it gives 404-not found.
With it gives 403 Forbidden.

If i am looking at the debug logs all seems OK: nginx feeds
/var/www/chrony/ to fcgiwraper. /var/www/chrony/ 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: -> -> -> ->

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list