So I'm trying to setup a default nginx config file that can be deployed across numerous docker image with different website configs in each container. It is currently set as below:
server {
listen 80 default_server;
root /var/www/;
index index.php index.html;
server_name localhost;
include php5-fpm.conf;
location / {
try_files $uri $uri/ /index.php?q=$request_uri;
}
location /status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
}
The problem is that it doesn't work for static sites that use index.htm or index.html
I can edit the location section like below and then the site will work. Is there any way to get nginx to use a wildcard, so index.* and it will use whichever index file it finds? index.* by itself does not work so not sure what needs to be added/removed...
location / {
try_files $uri /index.htm?q=$request_uri;
}