I have use Kali linux in AWS to deploy a simplest demo website(only show index.html in /var/www).
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
#include /etc/nginx/conf.d/*.conf;
#include /etc/nginx/sites-enabled/*;
server {
listen 80 default_server;
server_name example.com;
location / {
root /var/www/;
index index.html;
}
}
when I visit the website using example.com, my index file in /var/www/ did not show, but only shows: This site can’t be reached.
I have used nginx -t -c /etc/nginx/nginx.conf to check and my nginx config file is tested successfully.
after that I used /etc/init.d/nginx restart , still get" This site can’t be reached" error.
question from:
https://stackoverflow.com/questions/65839790/could-not-show-index-html-visiting-example-com 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…