Score:0

"/etc/nginx/nginx.conf is meant to be read-only" when editing with nano after upgrading Ubuntu 20.04 to Ubuntu 22.04

mx flag

I am recently upgraded Ubuntu Server 20.04 to Ubuntu Server 22.04. It is a LEMP server running the latest Mainline version of Nginx. After the upgrade, when I try modifying the /etc/nginx/nginx.conf file with nano editor, nano shows a warning in red that says

/etc/nginx/nginx.conf is meant to be read-only

What is this error about, and since when is my nginx.conf file meant to be read-only? Is this an nginx issue, a nano issue, or a filesystem permissions issue, or all of the above? What can I do to fix this error? Please see screenshot below.

Nginx.conf is meant to be read-only

cn flag
What permissions are on /etc/nginx/nginx.conf file? (`ls -ld /etc/nginx/nginx.conf`) From which user are you using `nano`? (`id`) Is it `root`, do you use `sudo`?
Lex Li avatar
vn flag
So, in the end you will find it is never a good idea to put all sites in a single config file, so you won't edit `/etc/nginx/nginx.conf` much. Examples can be found in https://webdock.io/en/docs/how-guides/shared-hosting-multiple-websites/how-configure-nginx-to-serve-multiple-websites-single-vps It's not an issue, but more like a best practice embraced by many production web server administrators.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.