<div dir="ltr"><div dir="ltr">OK. Trying with a completely different question:<div><br></div><div>My server serves /var/www/html directory-content as static pages to http://<server>/</div><div><br></div><div>How do I have to set it up to additionally serve http://<server>/chrony from /var/www/chrony?</div><div><br></div><div>I've tried with:</div><div>server {<br>    listen 443 default_server ssl;<br>    listen [::]:443 default_server ssl;<br><br>    server_name <a href="http://nc409-muc.bfs.de">nc409-muc.bfs.de</a>;<br>    root /var/www/chrony;<br>    index index.sh index.html;<br><br>    location / {<br>        try_files $uri $uri/ $uri/index.sh;<br>    }<br><br>    location ~ "index\.sh$" {<br>        gzip off;<br>        fastcgi_pass unix:/var/run/fcgiwrap.socket;<br>        include /etc/nginx/fastcgi_params;<br>        fastcgi_param DOCUMENT_ROOT $document_root;<br>        fastcgi_param SCRIPT_FILENAME $request_filename;<br>    }<br>}<br></div><div><br></div><div>But this leads to error 404 - not found.</div><div><br></div><div><br></div><div>I've tried with:</div><div>server {<br>    listen 443 default_server ssl;<br>    listen [::]:443 default_server ssl;<br><br>    server_name <a href="http://nc409-muc.bfs.de">nc409-muc.bfs.de</a>;<br>    root /var/www;<br>    index index.sh index.html;<br><br>    location /chrony {<br>        try_files $uri $uri/ $uri/index.sh;<br>    }<br><br>    location ~ "index\.sh$" {<br>        gzip off;<br>        fastcgi_pass unix:/var/run/fcgiwrap.socket;<br>        include /etc/nginx/fastcgi_params;<br>        fastcgi_param DOCUMENT_ROOT $document_root;<br>        fastcgi_param SCRIPT_FILENAME $request_filename;<br>    }<br>}<br></div><div><br></div><div>But this also lead to error - 404 - not found.</div><div><br></div><div>I did not have success with:</div><div>server {<br>    listen 443 default_server ssl;<br>    listen [::]:443 default_server ssl;<br><br>    server_name <a href="http://nc409-muc.bfs.de">nc409-muc.bfs.de</a>;<br>    root /var/www/chrony;<br>    index index.sh index.html;</div><div><br>    location ~ "index\.sh$" {<br>        gzip off;<br>        fastcgi_pass unix:/var/run/fcgiwrap.socket;<br>        include /etc/nginx/fastcgi_params;<br>        fastcgi_param DOCUMENT_ROOT $document_root;<br>        fastcgi_param SCRIPT_FILENAME $request_filename;<br>    }<br>}<br></div><div><br></div><div>lead to 404 - not found.</div><div><br></div><div>or</div><div><br></div><div>server {<br>    listen 443 default_server ssl;<br>    listen [::]:443 default_server ssl;<br><br>    server_name <a href="http://nc409-muc.bfs.de">nc409-muc.bfs.de</a>;<br>    root /var/www/chrony;<br>    index index.sh index.html;<br><br>    location ~ "index\.sh$" {<br>        gzip off;<br>        fastcgi_pass unix:/var/run/fcgiwrap.socket;<br>        include /etc/nginx/fastcgi_params;<br>        fastcgi_param DOCUMENT_ROOT $document_root;<br>        fastcgi_param SCRIPT_FILENAME $request_filename;<br>    }<br>}<br></div><div><br></div><div>lead to 404 - not found.</div><div><br></div><div>But the file is there:</div><div>/var/www:<br>insgesamt 16<br>drwxr-xr-x  4 root root 4096 Dez  2 16:25 .<br>drwxr-xr-x 12 root root 4096 Aug 20 12:58 ..<br>drwxr-xr-x  2 root root 4096 Dez  4 17:17 chrony<br>drwxr-xr-x  2 root root 4096 Aug 20 12:58 html<br><br>/var/www/chrony:<br>insgesamt 16<br>drwxr-xr-x 2 root root 4096 Dez  4 17:17 .<br>drwxr-xr-x 4 root root 4096 Dez  2 16:25 ..<br>-rw-r--r-- 1 root root   95 Dez  3 13:42 chrony.css<br>-rwxr-xr-x 1 root root 1712 Dez  3 16:07 index.sh<br><br>/var/www/html:<br>insgesamt 12<br>drwxr-xr-x 2 root root 4096 Aug 20 12:58 .<br>drwxr-xr-x 4 root root 4096 Dez  2 16:25 ..<br>-rw-r--r-- 1 root root  612 Aug 20 12:58 index.nginx-debian.html<br></div><div><br></div><div>and nginx -T does:</div><div>nginx: the configuration file /etc/nginx/nginx.conf syntax is ok<br>nginx: configuration file /etc/nginx/nginx.conf test is successful<br></div><div><br></div><div>With configuration:</div><div># configuration file /etc/nginx/nginx.conf:<br>user www-data;<br>worker_processes auto;<br>pid /run/nginx.pid;<br>include /etc/nginx/modules-enabled/*.conf;<br><br>events {<br>     worker_connections 768;<br>       # multi_accept on;<br>}<br><br>http {<br>       sendfile on;<br>  tcp_nopush on;<br>        tcp_nodelay on;<br>       keepalive_timeout 65;<br> types_hash_max_size 2048;<br>     include /etc/nginx/mime.types;<br>        default_type application/octet-stream;<br>        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE<br>    ssl_prefer_server_ciphers on;<br> access_log /var/log/nginx/access.log;<br> error_log /var/log/nginx/error.log;<br>   gzip on;<br>      gzip_disable "msie6";<br>       include /etc/nginx/conf.d/*.conf;<br>     include /etc/nginx/sites-enabled/*;<br>}<br><br>load_module modules/ngx_http_auth_pam_module.so;<br>load_module modules/ngx_http_dav_ext_module.so;<br>load_module modules/ngx_http_echo_module.so;<br>load_module modules/ngx_http_geoip_module.so;<br>load_module modules/ngx_http_image_filter_module.so;<br>load_module modules/ngx_http_subs_filter_module.so;<br>load_module modules/ngx_http_upstream_fair_module.so;<br>load_module modules/ngx_http_xslt_filter_module.so;<br>load_module modules/ngx_mail_module.so;<br>load_module modules/ngx_stream_module.so;<br><br>types {<br>    text/html                             html htm shtml;<br>    text/css                              css;<br>    text/xml                              xml;<br>    image/gif                             gif;<br>    image/jpeg                            jpeg jpg;<br>    application/javascript                js;<br>    application/atom+xml                  atom;<br>    application/rss+xml                   rss;<br><br>    text/mathml                           mml;<br>    text/plain                            txt;<br>    text/vnd.sun.j2me.app-descriptor      jad;<br>    text/vnd.wap.wml                      wml;<br>    text/x-component                      htc;<br><br>    image/png                             png;<br>    image/tiff                            tif tiff;<br>    image/vnd.wap.wbmp                    wbmp;<br>    image/x-icon                          ico;<br>    image/x-jng                           jng;<br>    image/x-ms-bmp                        bmp;<br>    image/svg+xml                         svg svgz;<br>    image/webp                            webp;<br><br>    application/font-woff                 woff;<br>    application/java-archive              jar war ear;<br>    application/json                      json;<br>    application/mac-binhex40              hqx;<br>    application/msword                    doc;<br>    application/pdf                       pdf;<br>    application/postscript                ps eps ai;<br>    application/rtf                       rtf;<br>    application/vnd.apple.mpegurl         m3u8;<br>    application/vnd.ms-excel              xls;<br>    application/vnd.ms-fontobject         eot;<br>    application/vnd.ms-powerpoint         ppt;<br>    application/vnd.wap.wmlc              wmlc;<br>    application/vnd.google-earth.kml+xml  kml;<br>    application/vnd.google-earth.kmz      kmz;<br>    application/x-7z-compressed           7z;<br>    application/x-cocoa                   cco;<br>    application/x-java-archive-diff       jardiff;<br>    application/x-java-jnlp-file          jnlp;<br>    application/x-makeself                run;<br>    application/x-perl                    pl pm;<br>    application/x-pilot                   prc pdb;<br>    application/x-rar-compressed          rar;<br>    application/x-redhat-package-manager  rpm;<br>    application/x-sea                     sea;<br>    application/x-shockwave-flash         swf;<br>    application/x-stuffit                 sit;<br>    application/x-tcl                     tcl tk;<br>    application/x-x509-ca-cert            der pem crt;<br>    application/x-xpinstall               xpi;<br>    application/xhtml+xml                 xhtml;<br>    application/xspf+xml                  xspf;<br>    application/zip                       zip;<br><br>    application/octet-stream              bin exe dll;<br>    application/octet-stream              deb;<br>    application/octet-stream              dmg;<br>    application/octet-stream              iso img;<br>    application/octet-stream              msi msp msm;<br><br>    application/vnd.openxmlformats-officedocument.wordprocessingml.document    docx;<br>    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet          xlsx;<br>    application/vnd.openxmlformats-officedocument.presentationml.presentation  pptx;<br><br>    audio/midi                            mid midi kar;<br>    audio/mpeg                            mp3;<br>    audio/ogg                             ogg;<br>    audio/x-m4a                           m4a;<br>    audio/x-realaudio                     ra;<br><br>    video/3gpp                            3gpp 3gp;<br>    video/mp2t                            ts;<br>    video/mp4                             mp4;<br>    video/mpeg                            mpeg mpg;<br>    video/quicktime                       mov;<br>    video/webm                            webm;<br>    video/x-flv                           flv;<br>    video/x-m4v                           m4v;<br>    video/x-mng                           mng;<br>    video/x-ms-asf                        asx asf;<br>    video/x-ms-wmv                        wmv;<br>    video/x-msvideo                       avi;<br>}<br><br>server {<br>    listen 80 default_server;<br>    listen [::]:80 default_server;<br><br>    server_name _;<br><br>    return 301 https://$host$request_uri;<br>}<br><br>server {<br>    listen 443 default_server ssl;<br>    listen [::]:443 default_server ssl;<br><br>    server_name _;<br><br>    ssl_certificate      /etc/ssl/certs/nginx.crt;<br>    ssl_certificate_key  /etc/ssl/private/nginx.key;<br><br>    root /var/www/html;<br>    index index.html index.htm index.nginx-debian.html;<br><br>    location / {<br>        # First attempt to serve request as file, then<br>        # as directory, then fall back to displaying a 404.<br>        try_files $uri $uri/ =404;<br>    }<br><br>    location /chrony {<br>        root /var/www/chrony;<br>        try_files $uri $uri/ $uri/index.sh;<br>    }<br><br>    location ~ "index\.sh$" {<br>        gzip off;<br>        fastcgi_pass unix:/var/run/fcgiwrap.socket;<br>        include /etc/nginx/fastcgi_params;<br>        fastcgi_param DOCUMENT_ROOT $document_root;<br>        fastcgi_param SCRIPT_FILENAME $request_filename;<br>    }<br>}<br><br><br># configuration file /etc/nginx/fastcgi_params:<br><br>fastcgi_param  QUERY_STRING       $query_string;<br>fastcgi_param  REQUEST_METHOD     $request_method;<br>fastcgi_param  CONTENT_TYPE       $content_type;<br>fastcgi_param  CONTENT_LENGTH     $content_length;<br><br>fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;<br>fastcgi_param  REQUEST_URI        $request_uri;<br>fastcgi_param  DOCUMENT_URI       $document_uri;<br>fastcgi_param  DOCUMENT_ROOT      $document_root;<br>fastcgi_param  SERVER_PROTOCOL    $server_protocol;<br>fastcgi_param  REQUEST_SCHEME     $scheme;<br>fastcgi_param  HTTPS              $https if_not_empty;<br><br>fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;<br>fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;<br><br>fastcgi_param  REMOTE_ADDR        $remote_addr;<br>fastcgi_param  REMOTE_PORT        $remote_port;<br>fastcgi_param  SERVER_ADDR        $server_addr;<br>fastcgi_param  SERVER_PORT        $server_port;<br>fastcgi_param  SERVER_NAME        $server_name;<br><br># PHP only, required if PHP was built with --enable-force-cgi-redirect<br>fastcgi_param  REDIRECT_STATUS    200;<br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 6, 2019 at 1:29 PM Francis Daly <<a href="mailto:francis@daoine.org">francis@daoine.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Dec 06, 2019 at 12:39:59PM +0100, Thomas Schweikle wrote:<br>
<br>
Hi there,<br>
<br>
This config fails to run for me.<br>
<br>
So, unless something very strange is happening, this is not the config<br>
that your running nginx is actually using.<br>
<br>
>     location ~ "index\.sh"$ {<br>
<br>
$ sbin/nginx -t<br>
nginx: [emerg] unexpected "$" in /usr/local/nginx/conf/nginx.conf:19<br>
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed<br>
$ sed -n 19p /usr/local/nginx/conf/nginx.conf<br>
    location ~ "index\.sh"$ {<br>
<br>
Changing that line to be<br>
<br>
    location ~ "index\.sh$" {<br>
<br>
allows it to run.<br>
<br>
> For https://<fqdn-server>/:<br>
> nginx default site delivered ok.<br>
<br>
Your provided config says that that should serve something from<br>
/var/www/chrony. You seem to report that it is serving something from<br>
/var/www/html.<br>
<br>
> For https://<fqdn-server>/chrony:<br>
> 404 - Not found.<br>
<br>
Your provided config says that that should serve something from<br>
/var/www/chrony/chrony, which I think you show does not exist, so 404<br>
is correct.<br>
<br>
But I suspect that your actual running config is trying to serve something<br>
from /var/www/html/chrony, which also does not exist, so 404 is created.<br>
<br>
<br>
I think that you will need to identify the actual running config,<br>
because that will make it easier to make the changes that you want.<br>
<br>
Cheers,<br>
<br>
        f<br>
-- <br>
Francis Daly        <a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Thomas</div></div></div>