-
Bug DescriptionWhen using the Custom Nginx Configuration feature in the Advanced settings (⚙️) of a proxy host, NPMplus writes the custom configuration outside the Affected Version
Steps to Reproduce
# WebSocket Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Custom Headers
proxy_set_header Host $host;
proxy_buffering off;
Expected BehaviorCustom nginx directives should be placed inside the server {
server_name example.com;
# ... server config ...
location / {
include proxy-headers.conf;
# ✅ Custom config HERE (inside location block)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_buffering off;
proxy_pass http://192.168.1.x:xxxx;
}
}Actual BehaviorCustom nginx directives are placed outside the server {
server_name example.com;
# ... server config ...
location / {
include proxy-headers.conf;
proxy_pass http://192.168.1.x:xxxx;
}
# custom locations
# ❌ Custom config HERE (outside location block - INVALID!)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_buffering off;
# Custom
include /data/custom_nginx/server_proxy.conf;
}Impact
Error Messages$ docker exec npmplus nginx -t
nginx: [emerg] "proxy_http_version" directive is not allowed here in /data/nginx/proxy_host/xxx.conf:XX
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failedAffected Use CasesThis bug particularly affects configurations for:
WorkaroundUsers must manually edit the generated config files: # Edit the generated config
sudo nano /data/nginx/proxy_host/xxx.conf
# Move all custom directives from after "# custom locations"
# into the location / block
# Test and reload
docker exec npmplus nginx -t
docker exec npmplus nginx -s reloadNote: This workaround is temporary and gets overwritten on next GUI update. Additional Context
Suggested FixThe template engine generating the nginx configuration should place custom nginx configuration inside the
Related ConfigurationsThis bug does not affect:
Environment:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
|
no I will not talk to AI |
Beta Was this translation helpful? Give feedback.
-
|
Hello Zoey, I asked Claude to help me on this as I love your new npmplus version, as I could't write it that precise. I am sorry, iI didn't mean to upset you with that. Many thanks, Michael |
Beta Was this translation helpful? Give feedback.
-
|
Dear Zoey, sorry for the confusion. Let me describe the actual problem I'm experiencing (in my onw words): When I add custom nginx directives in the Advanced tab (gear icon), Example: I need to set specific headers for my service, but when I add:
These appear after the location / block closes, not inside it. Is this the expected behavior, or should I configure this differently? Thanks, |
Beta Was this translation helpful? Give feedback.
-
|
I now fully understand the way NPMplus works - so many things are now already implemented "right out of the box" 😃 Thanks a lot fpr this great piece of development! |
Beta Was this translation helpful? Give feedback.
yes this is expected behaviour. For proxy_buffering this is fine (I'm adding a button to faster trigger this), but why do you want to override the host header? NPMplus already sets it correctly