nginx重新规则注意事项

nginx rewrite 重写使用

  • rewrite url 后没达到理想结果,php内容变为直接暂时源码。
  • 排查对比,rewrite old_url new_url last; 在正则location 下不生效

    location ^~ /ext_url {

     rewrite . /new_url.php last; # 不生效,将location 改为普通匹配即可

    }

python字符format串格式化输出大括号

str format输出 {} 方法

字符串中包含{}的情况,单个{}会被解析为填入内容,使用{{}}输出{}

print('我想生成一段含有{}的字符串, 填充内容为 {} '.format('string'))
print('我想生成一段含有{{}}的字符串, 填充内容为 {} '.format('string'))