nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.37k stars 323 forks source link

"error": "Failed to apply new configuration." #1409

Closed Furuk1 closed 3 weeks ago

Furuk1 commented 3 weeks ago

Can someone please tell me how to resolve this error?

json file is: { "listeners": { "127.0.0.1:443": { "pass": "applications/mockup", "tls": { "certificate": "fullchain" } } }, "applications": { "mockup": { "type": "python 3.9", "path": "/var/www/html/mockup", "module": "wsgi" } } }

execute: sudo curl -X PUT --data-binary @/etc/unit/mockup.json --unix-socket /var/run/unit/control.sock http://localhost/config

occurred error: "error": "Failed to apply new configuration."

Furuk1 commented 3 weeks ago

unit.log is: 2024/09/02 13:39:06 [alert] 1145771#1145771 bind(\"127.0.0.1:443\") failed (98: Address already in use) 2024/09/02 13:39:06 [alert] 1145774#1145774 failed to apply new conf

Furuk1 commented 3 weeks ago

I was able to resolve it. [1st.] service nginx stop [2nd.] Proxy settings from “nginx” to “unit”. In this case, port 443 is used for "nginx", and port 8300 is used for "unit".

callahad commented 3 weeks ago

I'm glad you were able to resolve it; thank you for following up :)