2

I'm on Arch Linux and installed nginx-mainline. I get an error when running sudo systemctl start. Here's the output of sudo systemctl status nginx.service:

     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sat 2020-08-22 21:04:55 EDT; 8s ago
    Process: 2660 ExecStart=/usr/bin/nginx -g pid /run/nginx.pid; error_log stderr; (code=exited, status=1/FAILURE)

Aug 22 21:04:55 archlinux.homelab.local systemd[1]: Starting A high performance web server and a reverse proxy server...
Aug 22 21:04:55 archlinux.homelab.local nginx[2660]: 2020/08/22 21:04:55 [emerg] 2660#2660: open() "/etc/nginx/mime.types" failed (2: No such file or directory) in /etc/nginx/nginx.conf:18
Aug 22 21:04:55 archlinux.homelab.local systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Aug 22 21:04:55 archlinux.homelab.local systemd[1]: nginx.service: Failed with result 'exit-code'.
Aug 22 21:04:55 archlinux.homelab.local systemd[1]: Failed to start A high performance web server and a reverse proxy server.

My /etc/nginx/nginx.conf file includes this:

http {
    include       mime.types;
    # Bunch of other code I've excluded for simplicity
}

And it's true, there's not mime.types file in /etc/nginx/. How do I get nginx working?

2
+100

I dunno about arch-linux, but normally the package should include the file.

However, you can always get a replacement from upstream :-)

https://raw.githubusercontent.com/nginx/nginx/master/conf/mime.types

That contains the current master mime.types file.

You can just download that file and put it in the configuration directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.