Welcome! Log In Create A New Profile

Advanced

Serving a subdirectory

Thomas Schweikle
December 04, 2019 01:10PM
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
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Serving a subdirectory

Thomas Schweikle December 04, 2019 01:10PM

Re: Serving a subdirectory

Francis Daly December 05, 2019 10:04AM

Re: Serving a subdirectory

Thomas Schweikle December 06, 2019 06:42AM

Re: Serving a subdirectory

Francis Daly December 06, 2019 07:30AM

Re: Serving a subdirectory

Thomas Schweikle December 06, 2019 10:48AM

Re: Serving a subdirectory

Francis Daly December 06, 2019 03:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 317
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready