diff --git a/README.md b/README.md index 6dd5a177..657905eb 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ services: - 81:81 - 443:443 volumes: + - ./data:/data - ./letsencrypt:/etc/letsencrypt ``` @@ -50,6 +51,7 @@ docker run -d \ -p 80:80 \ -p 81:81 \ -p 443:443 \ + -v /path/to/data:/data \ -v /path/to/letsencrypt:/etc/letsencrypt \ jc21/nginx-proxy-manager ``` @@ -82,3 +84,4 @@ I won't go in to too much detail here but here are the basics for someone new to 2. Add port forwarding for port 80 and 443 to the server hosting this project 3. Configure your domain name details to point to your home, either with a static ip or a service like DuckDNS 4. Use the Nginx Proxy Manager here as your gateway to forward to your other web based services + diff --git a/rootfs/etc/nginx/nginx.conf b/rootfs/etc/nginx/nginx.conf index 6007c413..fb446246 100644 --- a/rootfs/etc/nginx/nginx.conf +++ b/rootfs/etc/nginx/nginx.conf @@ -9,7 +9,7 @@ worker_processes auto; # Enables the use of JIT for regular expressions to speed-up their processing. pcre_jit on; -error_log /config/logs/error.log warn; +error_log /data/logs/error.log warn; # Includes files with directives to load dynamic modules. include /etc/nginx/modules/*.conf; @@ -48,12 +48,13 @@ http { # - (dash) - request never reached to upstream module. Most likely it was processed at Nginx-level only (e.g. forbidden, redirects, etc) (Ref: Mail Thread log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"'; - access_log /config/logs/default.log proxy; + access_log /data/logs/default.log proxy; include /etc/nginx/conf.d/*.conf; - include /config/nginx/*.conf; + include /data/nginx/*.conf; } stream { - include /config/nginx/stream/*.conf; + include /data/nginx/stream/*.conf; } + diff --git a/rootfs/etc/services.d/nginx/run b/rootfs/etc/services.d/nginx/run index 3d2c9f97..0ae11026 100755 --- a/rootfs/etc/services.d/nginx/run +++ b/rootfs/etc/services.d/nginx/run @@ -1,5 +1,10 @@ #!/usr/bin/with-contenv bash -mkdir -p /tmp/nginx /data/{nginx,logs,access} /data/nginx/stream /var/lib/nginx/cache/{public,private} +mkdir -p /tmp/nginx \ + /data/{nginx,logs,access} \ + /data/nginx/stream \ + /var/lib/nginx/cache/{public,private} + chown root /tmp/nginx exec nginx +