Nginx欢迎页面的index.html文件存在于哪个目录?

问题描述

我正在使用centos7 + php-fpm在vagrant上尝试Nginx。 配置文件如下,

<pre>'
vi nginx.conf  
—————————   
user  nginx;  
worker_processes  1;  

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


events {  
    worker_connections  1024;  
}   


http {  
    include       /etc/nginx/mime.types;  
    default_type  application/octet-stream;  
  
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '  
                      '$status $body_bytes_sent "$http_referer" '   
                      '"$http_user_agent" "$http_x_forwarded_for"';  

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

    sendfile        off;  
    tcp_nopush     on;  

    keepalive_timeout  65;  

    #gzip  on;  

    include /etc/nginx/conf.d/*.conf;  
}

 vi conf.d/default.conf      
————————————    
server {    
    listen      192.168.33.58;  

    proxy_set_header X-Real-IP $remote_addr;  
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
    proxy_set_header Host $http_host;  
    proxy_redirect off;  
    proxy_max_temp_file_size 0;  
    fastcgi_buffers 8 16k;   
    fastcgi_buffer_size 32k;   
    index index.php index.html index.htm;   
    root  /usr/share/nginx/html;   

    location / {
        try_files $uri $uri/ /index.php?$query_string;  
    }

    location ~ \.php$ {  
        fastcgi_split_path_info ^(.+\.php)(/.+)$;   
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;   
        fastcgi_index index.php;  
        include fastcgi_params;   
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
        fastcgi_param PATH_INFO $fastcgi_path_info;  

    }
}   
vi fastcgi_params   
——————————  
fastcgi_param  QUERY_STRING       $query_string;  
fastcgi_param  REQUEST_METHOD     $request_method;  
fastcgi_param  CONTENT_TYPE       $content_type;  
fastcgi_param  CONTENT_LENGTH     $content_length;   

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;  
fastcgi_param  REQUEST_URI        $request_uri;  
fastcgi_param  DOCUMENT_URI       $document_uri;  
fastcgi_param  DOCUMENT_ROOT      $document_root;  
fastcgi_param  SERVER_PROTOCOL    $server_protocol;  
fastcgi_param  REQUEST_SCHEME     $scheme;   
fastcgi_param  HTTPS              $https if_not_empty;   

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;  
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;   

fastcgi_param  REMOTE_ADDR        $remote_addr;  
fastcgi_param  REMOTE_PORT        $remote_port;   
fastcgi_param  SERVER_ADDR        $server_addr;     
fastcgi_param  SERVER_PORT        $server_port;   
fastcgi_param  SERVER_NAME        $server_name;  
# PHP only,required if PHP was built with --enable-force-cgi-redirect  
fastcgi_param  REDIRECT_STATUS    200   

vi /etc/php-fpm.d/www.conf   
———————————    
user = nginx  
group = nginx  

listen = /var/run/php-fpm/php-fpm.sock  

listen.owner = nginx  
listen.group = nginx  
'</pre>
o

在浏览器上,我看到一个页面,显示“欢迎使用nginx”。 我在/ usr / share / nginx / html找到了index.html文件。 到目前为止,还不错。
但是当我稍后重新加载浏览器时,浏览器显示了不同的页面,其中显示“欢迎使用Fedora上的Nginx
这很奇怪。 我找不到与操作系统名称不符的页面的index.html文件。它在哪里?
为什么有两个欢迎页面?
我已经花了4天了。 我真的很感谢有人给我一个提示!
预先感谢您对我的帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...