Question

Python Nginx Restart Error

Posted December 6, 2021 134 views
NginxPythonUbuntu 16.04Flask

I’m building a web api with Flask. I got error when I use “sudo systemctl restart nginx” for ngnix restart after server installations, wsgi installations

$ sudo systemctl status nginx.servic

nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-12-06 09:36:31 UTC; 23h ago
Docs: man:nginx(8)
Process: 3210037 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Dec 06 09:36:31 systemd[1]: Starting A high performance web server and a reverse proxy server…
Dec 06 09:36:31 nginx[3210037]: nginx: [emerg] unknown directive “brotli” in /etc/nginx/conf.d/brotli.conf:1
Dec 06 09:36:31 nginx[3210037]: nginx: configuration file /etc/nginx/nginx.conf test failed
Dec 06 09:36:31 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Dec 06 09:36:31 systemd[1]: nginx.service: Failed with result ‘exit-code’.
Dec 06 09:36:31 systemd[1]: Failed to start A high performance web server and a reverse proxy server.

How can I solve this?
I checked sites-enabled and sites-available?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Paste contents of /etc/nginx/nginx.conf and /etc/nginx/conf.d/brotli.conf