在centos7中,啓動openresty時報錯:
Job for openresty.service failed because the control process exited with error code. See "systemctl status openresty.service" and "journalctl -xe" for details.
然後執行:
systemctl status openresty.service
發現:
● openresty.service - The OpenResty Application Platform
Loaded: loaded (/usr/lib/systemd/system/openresty.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 四 2020-04-02 13:49:01 CST; 2min 14s ago
4月 02 13:49:01 localhost.localdomain systemd[1]: Starting The OpenResty Application Platform...
4月 02 13:49:01 localhost.localdomain nginx[3895]: nginx: [emerg] unknown directive "limit" in /usr/local/openresty/nginx/conf/nginx.conf:35
4月 02 13:49:01 localhost.localdomain nginx[3895]: nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed
4月 02 13:49:01 localhost.localdomain systemd[1]: openresty.service: control process exited, code=exited status=1
4月 02 13:49:01 localhost.localdomain systemd[1]: Failed to start The OpenResty Application Platform.
4月 02 13:49:01 localhost.localdomain systemd[1]: Unit openresty.service entered failed state.
4月 02 13:49:01 localhost.localdomain systemd[1]: openresty.service failed.
查看以上信息,可知:
4月 02 13:49:01 localhost.localdomain nginx[3895]: nginx: [emerg] unknown directive "limit" in /usr/local/openresty/nginx/conf/nginx.conf:35
應該是該配置文件有誤。最後成功。