This seems to be a configuration issue, because you might have two sites
configured with the `listen 80 default_server;` line defined.
You can only have `default_server` defined once. You need to go through
your individual sites listed in `/etc/nginx/sites-enabled/` and
`/etc/nginx/nginx.conf` and `/etc/nginx/conf.d/` that you have
configured and find the two `default_server` lines that you've
configured, and pick *one* of them to be the default server. Then remove
`default_server` from the other one.
Relevant output from your logs:
"""
Jul 31 19:01:19 Ubuntu nginx[20926]: 2025/07/31 19:01:19 [emerg] 20926#20926: a
duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/default:22
Jul 31 19:01:19 Ubuntu nginx[20926]: nginx: configuration file
/etc/nginx/nginx.conf test failed
Jul 31 19:01:19 Ubuntu systemd[1]: [0;1;39m[0;1;31m[0;1;39mnginx.service:
Control process exited, code=exited, status=1/FAILURE[0m
"""
So this is probably a duplicate of bug #1769285 – Please confirm if you
can fix the issue by adopting your configuration around default_server.
** Summary changed:
- package nginx 1.26.3-2ubuntu1.1 failed to install/upgrade: installed nginx
package post-installation script subprocess returned error exit status 1
+ package nginx 1.26.3-2ubuntu1.1 failed to install/upgrade: a duplicate
default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/default:22
** Changed in: nginx (Ubuntu)
Status: New => Incomplete
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2119328
Title:
package nginx 1.26.3-2ubuntu1.1 failed to install/upgrade: a duplicate
default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/default:22
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/2119328/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs