Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/etc/nginx/mime.types file not found #791

Closed
0x9090 opened this issue Mar 31, 2016 · 6 comments
Closed

/etc/nginx/mime.types file not found #791

0x9090 opened this issue Mar 31, 2016 · 6 comments

Comments

@0x9090
Copy link

0x9090 commented Mar 31, 2016

We are trying to use this module to set up an Nginx Reverse proxy which will also perform SSL termination. I am using version 0.3.0 of this module. When using this Puppet configuration,

class { 'nginx':
    manage_repo     => false,
    package_ensure  => 'latest',
  }
  nginx::resource::vhost { $::fqdn:
    listen_port => 443,
    ssl_port    => 443,
    ssl         => true,
    ssl_cert    => '/opt/###/tls/###.cer',
    ssl_key     => '/opt/###/tls/###.key',
    proxy       => 'http://127.0.0.1:8500',
  }

Nginx service throws the error on startup,

2016/03/31 11:00:22 [emerg] 24163#0: open() "/etc/nginx/mime.types" failed (2: No such file or directory) in /etc/nginx/nginx.conf:15

The generated /etc/nginx/nginx.conf looks like

# MANAGED BY PUPPET
user www-data;
worker_processes 1;
worker_rlimit_nofile 1024;

pid        /var/run/nginx.pid;
error_log  /var/log/nginx/error.log error;


events {
  worker_connections 1024;
}

http {
  include       /etc/nginx/mime.types;
  default_type  application/octet-stream;

  access_log  /var/log/nginx/access.log;

  sendfile    on;

  server_tokens on;

  types_hash_max_size 1024;
  types_hash_bucket_size 512;

  server_names_hash_bucket_size 64;
  server_names_hash_max_size 512;

  keepalive_timeout  65;
  tcp_nodelay        on;

  gzip              on;
  gzip_comp_level   1;
  gzip_disable      msie6;
  gzip_min_length   20;
  gzip_http_version 1.1;
  gzip_proxied      off;
  gzip_vary         off;

  client_body_temp_path   /var/nginx/client_body_temp;
  client_max_body_size    10m;
  client_body_buffer_size 128k;
  proxy_redirect          off;
  proxy_temp_path         /var/nginx/proxy_temp;
  proxy_connect_timeout   90;
  proxy_send_timeout      90;
  proxy_read_timeout      90;
  proxy_buffers           32 4k;
  proxy_buffer_size       8k;
  proxy_set_header        Host $host;
  proxy_set_header        X-Real-IP $remote_addr;
  proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_headers_hash_bucket_size 64;

  include /etc/nginx/conf.d/*.conf;
  include /etc/nginx/sites-enabled/*;
}

Is there a way to disable include /etc/nginx/mime.types; line in this module? It seems like that is the misbehaving configuration option

@gerases
Copy link
Contributor

gerases commented Apr 2, 2016

I had the same issue, but take a look inside your nginx package and that file should be there. It IS part of the nginx package. But in my case as well something happened to it during the lifetime of the machine. I've reinstalled the package and it's back. Hope this helps.

@0x9090
Copy link
Author

0x9090 commented Apr 4, 2016

Added back in a default mime.types file, and nginx sprang back to life. Not sure why this happened, as this is a fresh Debian Jessie machine

@0x9090
Copy link
Author

0x9090 commented Apr 4, 2016

The /etc/nginx/mime.types file that got me running -> https://gist.github.com/0x9090/ee977ce79ff67ce0208a1b6d68a5a190

@frozenfoxx
Copy link
Contributor

frozenfoxx commented Sep 26, 2016

Same issue here, fresh machine but it apparently isn't happy about it. I had to do an apt-get autoremove --purge nginx nginx-common nginx-core && rm -rf /var/www/html to get it all. After that it works okay.

@0x9090 0x9090 closed this as completed Oct 6, 2016
@ghost
Copy link

ghost commented Sep 10, 2021

I have seen links that DIE over time, so I have made a second link (clone) of what @0x9090 has posted
https://gist.github.com/smeletis/aad0526b857fdbf68654993f36d8c8c0

@0x8008
Copy link

0x8008 commented Sep 11, 2023

I have seen links that DIE over time, so I have made a second link (clone) of what @0x9090 has posted https://gist.github.com/smeletis/aad0526b857fdbf68654993f36d8c8c0

Quite ironic that this link is now dead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants