I migrated my WordPress websites from shared hosting to a single VPS. I am hosting the websites with a Plesk server. The Plesk is configured to serve the request with an Apache web server and Nginx as a reverse proxy server.
Now, I want to host a static website with Nginx at /var/www/bloggrammer.com
. I have added the nginx config for the static website at /etc/nginx/sites-available
and enabled it at /etc/nginx/sites-enabled
. I removed the default config file /etc/nginx/sites-available/default
and change the port number in /etc/nginx/sites-available/bloggrammer
from 80 to 8080 because apache is already using the default port, 80.
Below is my config file:
server {
listen *:8080;
listen [::]:8080;
server_name bloggrammer.com;
root /var/www/bloggrammer.com;
location / {
index index.html;
}
}
When I restart nigix using systemctl restart nginx
I get the following error:
Job for nginx.service failed because the control process exited with an error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
I ran nginx -t
for a syntax error in the configuration and I got this:
nginx: [emerg] unknown directive "brotli" in /etc/nginx/conf.d/brotli.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
I ran systemctl status nginx.service
and get the following:
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 Fri 2023-01-20 08:12:27 UTC; 16min ago
Docs: man:nginx(8)
Process: 1793904 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
How can I host the static website with Nginx while still having my WordPress websites running on Apache with Plesk?
PS: I am new to Linux machines and VPS hosting. Thank you in advance