Cómo configurar index.html para el nombre de dominio, p. https://www.example.com/ - lleva al usuario a index.html en el directorio raíz.Cómo configurar index.html como archivo raíz en Nginx?
He probado diferentes cosas como:
server {
# some configs
location =/{
index index.html;
fastcgi_index index.html;
}
or
location/{
index index.html;
fastcgi_index index.html;
}
}
Nada me ayudó.
Existen otras configuraciones con la palabra clave de ubicación, aunque ya las había comentado.
Otras configuraciones "ubicación" en la cláusula server {
:
location ~ .*(css|htc|js|bmp|jp?g|gif|ico|cur|png|swf|htm?|html)$ {
access_log off;
root $www_root;
}
location ~ \.php$
{
include /etc/nginx/fastcgi_params;
index index.html;
fastcgi_index index.html;
fastcgi_param SCRIPT_FILENAME $www_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass 127.0.0.1:9000;
# Директива определяет что ответы FastCGI-сервера с кодом больше или равные 400
# перенаправлять на обработку nginx'у с помощью директивы error_page
fastcgi_intercept_errors on;
break;
}
location ~ /\.ht {
deny all;
}
Todos ellos fueron comentadas y sin comentar, pero nada ayudó.
Las ediciones de PS se hicieron en el archivo /etc/nginx/sites- habilitado/domainname.com.
para mí 'index.html' funciona perfectamente. No importa en absoluto, es solo el nombre de un archivo en el sistema de archivos. –