Question

Python Nginx Restart Error

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?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

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