From c63412fbe596c8eca888b33507abd8490bade0ea Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Mon, 9 Sep 2024 14:10:13 -0700 Subject: [PATCH] fix: nginx in sshnpd containers --- tools/demo-env/sshnpd/entrypoint.sh | 3 +++ tools/demo-env/sshnpd/index.html | 2 +- tools/demo-env/sshnpd/nginx.conf | 28 +++++++--------------------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/tools/demo-env/sshnpd/entrypoint.sh b/tools/demo-env/sshnpd/entrypoint.sh index 61e320c5d..890024ff9 100644 --- a/tools/demo-env/sshnpd/entrypoint.sh +++ b/tools/demo-env/sshnpd/entrypoint.sh @@ -14,6 +14,9 @@ if [ -n "$POLICY" ]; then ARGS="-p $POLICY $ARGS" fi +# Start nginx +sudo /usr/sbin/nginx + echo Running command: /home/atsign/sshnpd -a \"$ATSIGN\" $ARGS # Run the NoPorts agent diff --git a/tools/demo-env/sshnpd/index.html b/tools/demo-env/sshnpd/index.html index 2e4a50192..445ef8ed1 100644 --- a/tools/demo-env/sshnpd/index.html +++ b/tools/demo-env/sshnpd/index.html @@ -26,6 +26,6 @@

Demo Web Page

shadow and night.

Files

- Go to files index + Go to files index diff --git a/tools/demo-env/sshnpd/nginx.conf b/tools/demo-env/sshnpd/nginx.conf index 8306856ee..164fd6060 100644 --- a/tools/demo-env/sshnpd/nginx.conf +++ b/tools/demo-env/sshnpd/nginx.conf @@ -1,44 +1,30 @@ user atsign; worker_processes auto; -error_log /var/log/nginx/error.log notice; - -# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. -# include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { - access_log /var/log/nginx/access.log main; - sendfile on; tcp_nopush on; keepalive_timeout 65; types_hash_max_size 4096; - include /etc/nginx/mime.types; - default_type application/octet-stream; - - # include /etc/nginx/conf.d/*.conf; - server { listen 80; listen [::]:80; - server_name _; - root /www - index index.html - - location / { - try_files $uri /index.html; - } - location /files { - root /files; + location ^~ /files/ { + alias /www/files/; autoindex on; autoindex_format html; autoindex_localtime on; } - # include /etc/nginx/default.d/*.conf; + location / { + root /www/; + try_files $uri $uri/ /index.html; + } } +}