Describe the bug
The "Configure WebSocket Support" instructions tell users to create nginx/vhost.d/<host> containing a location / { ... } block. But the generated server config already emits its own location / { ... } block, and the vhost.d file is included at server scope (not inside the existing location). The result is two sibling location / directives in the same server, which nginx rejects:
nginx: [emerg] duplicate location "/" in /etc/nginx/conf.d/default.conf
This pattern comes from nginx-proxy, which exposes two distinct include points per vhost:
vhost.d/<host> — included at server scope
vhost.d/<host>_location — included inside the generated location / block
The directives in the snippet (proxy_set_header Upgrade, proxy_read_timeout, client_max_body_size) only make sense inside a location block, so they need to go in the _location variant — without their own location { ... } wrapper. The docs currently mix the two conventions: _location-style contents written to a server-scope filename, with an extra location / wrapper on top.
Proposed fix
Update the snippet to:
cat > nginx/vhost.d/teldrive.yourdomain.com_location << 'EOL'
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
client_max_body_size 2000M;
EOL
Two changes: the filename gets the _location suffix, and the wrapping location / { ... } is removed. The directives are then injected into the existing location /, WebSocket upgrades and large uploads work, and no duplicate block is produced.
Reproduction
Follow the WebSocket Support section and create nginx/vhost.d/teldrive.yourdomain.com exactly as documented.
Reload nginx / restart the container.
Inspect the generated server block — as shown in the docs, it contains both include /etc/nginx/vhost.d/teldrive.yourdomain.com; (which injects a location /) and a literal location / { proxy_pass ...; } immediately after.
nginx refuses the config because location / is declared twice in the same server.
Expected behavior
WebSocket directives are merged into the existing location /, nginx reloads cleanly.
Version
1.8.3
Which Platform are you using?
Linux
Additional context
Offending nginx/conf.d/default.conf snippet:

Describe the bug
The "Configure WebSocket Support" instructions tell users to create
nginx/vhost.d/<host>containing alocation / { ... }block. But the generated server config already emits its ownlocation / { ... }block, and thevhost.dfile is included at server scope (not inside the existing location). The result is two sibling location / directives in the same server, which nginx rejects:This pattern comes from
nginx-proxy, which exposes two distinct include points pervhost:vhost.d/<host>— included at server scopevhost.d/<host>_location— included inside the generated location / blockThe directives in the snippet (
proxy_set_header Upgrade,proxy_read_timeout,client_max_body_size) only make sense inside a location block, so they need to go in the_locationvariant — without their ownlocation { ... }wrapper. The docs currently mix the two conventions:_location-style contents written to a server-scope filename, with an extralocation /wrapper on top.Proposed fix
Update the snippet to:
Two changes: the filename gets the
_locationsuffix, and the wrappinglocation / { ... }is removed. The directives are then injected into the existinglocation /, WebSocket upgrades and large uploads work, and no duplicate block is produced.Reproduction
Follow the WebSocket Support section and create
nginx/vhost.d/teldrive.yourdomain.comexactly as documented.Reload nginx / restart the container.
Inspect the generated server block — as shown in the docs, it contains both include
/etc/nginx/vhost.d/teldrive.yourdomain.com;(which injects alocation /) and a literallocation / { proxy_pass ...; }immediately after.nginx refuses the config because location / is declared twice in the same server.
Expected behavior
WebSocket directives are merged into the existing
location /, nginx reloads cleanly.Version
1.8.3
Which Platform are you using?
Linux
Additional context
Offending

nginx/conf.d/default.confsnippet: