如何设置 nginx unit的访问记录到日志的功能,如下代码所示,增加access_log段即可。
{
"listeners": {
"*:8300": {
"application": "default"
}
},
"applications": {
"default": {
"type": "php",
"processes": 10,
"root": "/app/public",
"index": "index.php",
"script": "index.php"
}
},
"access_log": "/var/log/unit/access.log"
}
修改php python 代码后,如何让代码生效。修改application的值即可, 例如,原来是下面的代码
{
"listeners": {
"*:8300": {
"application": "default"
}
},
"applications": {
"default": {
"type": "php",
"processes": 10,
"root": "/app/public",
"index": "index.php",
"script": "index.php"
}
},
"access_log": "/var/log/unit/access.log"
}
改成
{
"listeners": {
"*:8300": {
"application": "default1"
}
},
"applications": {
"default1": {
"type": "php",
"processes": 10,
"root": "/app/public",
"index": "index.php",
"script": "index.php"
}
},
"access_log": "/var/log/unit/access.log"
}
然后用curl 命令重新装载配置文件.即可,注意,两个default要一起改。