Serving a subdirectory

Francis Daly francis at daoine.org
Fri Dec 6 12:29:45 UTC 2019


On Fri, Dec 06, 2019 at 12:39:59PM +0100, Thomas Schweikle wrote:

Hi there,

This config fails to run for me.

So, unless something very strange is happening, this is not the config
that your running nginx is actually using.

>     location ~ "index\.sh"$ {

$ sbin/nginx -t
nginx: [emerg] unexpected "$" in /usr/local/nginx/conf/nginx.conf:19
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
$ sed -n 19p /usr/local/nginx/conf/nginx.conf
    location ~ "index\.sh"$ {

Changing that line to be

    location ~ "index\.sh$" {

allows it to run.

> For https://<fqdn-server>/:
> nginx default site delivered ok.

Your provided config says that that should serve something from
/var/www/chrony. You seem to report that it is serving something from
/var/www/html.

> For https://<fqdn-server>/chrony:
> 404 - Not found.

Your provided config says that that should serve something from
/var/www/chrony/chrony, which I think you show does not exist, so 404
is correct.

But I suspect that your actual running config is trying to serve something
from /var/www/html/chrony, which also does not exist, so 404 is created.


I think that you will need to identify the actual running config,
because that will make it easier to make the changes that you want.

Cheers,

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list