In my nginx configuration file I have the following lines:
location / {
try_files $uri $uri/ =404;
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
Now, I would like to comment out/uncomment the two lines programmatically:
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
So I thought about sed
and found this post here:
https://stackoverflow.com/a/27355109
Unfortunately I could not get it work. Perhaps there're problems with escapting the chars. Could someone help?