mime.types not included in default nginx configuration
Closed this issue · 4 comments
Hello!
There is no "include /etc/nginx/mime.types;" in default configs.
Only text/html is allowed.
So even a simple WordPress site doesn't work.
js/css don't work.
I spent a whole day to investigate that.
It would be better to keep original nginx.cfg (from nginx) in default setup.
Thanks for adding line "include /etc/nginx/mime.types" to default nginx config
But role still not working because there are no required or often used nginx files/snippets copied from default nginx package.
Including file mime.types.
This follows to error. Pls look at attached log: log.txt
I suppose such default behavior is confused.
Probably this happens because
- nginx-install role does not copy default nginx configs from nginx packages (Cannot understand why).
- And because the nginx-config role has "nginx_config_upload_enable" = false + role "files" folder is empty.
This is just my humble opinion that for a role is good to work just after run, with its default configuration.
The tests are passing which means that the file is correctly parsed by NGINX after using the NGINX installation role. nginx_config_upload_enable has nothing to do with creating the config (it's used to push configs from your controller node instead of using the templating capability). If mime.types is not found then it's getting deleted at some stage unrelated to this role.
The only reason that comes to mind is that you are not using our official repos and are using a distro repository instead, and NGINX packages from distro repositories do not always follow the standard package locations.
you are not using our official repos and are using a distro repository instead, and NGINX packages from distro repositories do >not always follow the standard package locations.
To check this out, I did on that server:
apt-get remove --purge nginx
apt install nginx
And I got nginx installed + all standard config files.
So it seems I use official repo.
Ok, thanks for idea. I will investigate it further.
That would install the NGINX package from the Ubuntu/Debian repo, not the official repo, unless you added the necessary signing keys and repos following our docs, in which case then I truly am out of ideas.
If you didn't use our docs, check out the instructions on the https://nginx.org website or use the core Ansible NGINX role to install NGINX from the official NGINX repo.