Failed to save configuration file


I want to change some lines in conf file but I received that error:

“Failed to save configuration file : Failed to replace /etc/nginx/sites-enabled/sitename.conf with /etc/nginx/sites-enabled/sitename.conf.webmintmp.54793 : Operation not permitted”

Then I tried to chane permission of this file from here: etc/nginx/sites-enabled

But this time: failed to change permissions 256

How can I edit this file?

Thanks in advance.

Is your disk full?

No, it’s not.

I disabled virtual server of the website and edited .conf file again(Webmin - Servers - Nginx Webserver - Edit Configuration Files) then tried to save it, but still same error.

Also I tried to save another website’s .conf file from server and it works but doesn’t work for other.

Did you change the attributes to make the file immutable? I’m not sure why one file would be unchangeable.

Can you edit it from the command line?

I didn’t make the file immutable but it’s fixed!
Thank you very much.

Here is the code if anybody is facing the same issue:
sudo chattr -i /etc/nginx/sites-enabled/sitename.conf