Здравствуйте. Почему-то не происходит замены подстроки в строке
https://ideone.com/Ryqs5Anginx = '''server {
listen 80;
#SSL
charset utf-8;
root /home/u36/web/basket.com;
index index.html;
server_name basket.com www.basket.com;
#ErrorPages
#Redirects
location / {
try_files \$uri \$uri/ /index.html;
}
location ~ /\.ht {
deny all;
}
location ~ \.php$ {
try_files \$uri /index.html =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php70-vhost_20;
fastcgi_index index.html;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
include fastcgi_params;
}
}
'''
oldname = 'basket.com'
newname = 'gogol.ru'
oldcharset = 'utf-8'
newcharset = 'cp-1251'
oldindex = 'index.php'
newindex = 'index.html'
ngreplacement = {
oldname: newname,
oldcharset: newcharset,
oldindex: newindex
}
for i, j in ngreplacement.items():
newng = nginx.replace(i, j)
print(newng)