DragonFreedom 2018-02-27 06:41 采纳率: 0%
浏览 3644
已结题

通过localhost访问nginx首页,一直等待

我在跟着视频做淘淘商城,在集成fastDFS和nginx的虚拟机上,安装的nginx一直没法用,用localhost访问时一直处于等待的状态,各种办法都试,没有成功,无奈,在此提问,望热心朋友指点一二

虚拟机是centos7,用firefox,一直处于一下状态
图片说明

这是我安装完查看nginx启动状态的信息,好像和网上教程显示的不一样,我的只有两行,正常的有三行,有没有可能是我的nginx安装有问题

 [root@localhost sbin]# ps -ef|grep nginx
root       3102      1  0 13:17 ?        00:00:00 nginx: master process ./nginx
root       4249   4119  0 14:35 pts/1    00:00:00 grep --color=auto nginx

我的nginx.conf还没有修改去添加fdfs,样子如下(我只列出server部分,其他应该不重要吧)

 server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

防火墙、iptables、换端口都试过了,现在已无力回天,只求大佬赐教!

  • 写回答

8条回答

  • 夏侯青城 2018-02-27 06:43
    关注

    server {
    listen 80;
    server_name localhost;
    access_log /alidata/log/nginx/localhost.log combined;
    error_log /alidata/log/nginx/localhost.log info;
    root /alidata/www/htdocs;
    index index.html index.htm index.php;

    location / {
    index index.html index.htm index.php;
    if (!-e $request_filename) {
    rewrite ^(.*)$ /index.php?s=$1 last;
    break;
    }
    }
    location ~ .+.php(/|$) {
    fastcgi_pass unix:/dev/shm/php-cgi.sock;
    fastcgi_index index.php;
    fastcgi_split_path_info ^((?U).+.php)(/?.+)$;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
    include fastcgi_params;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
      expires 30d;
      access_log off;
    }
    location ~ .*\.(js|css)?$ {
      expires 7d;
      access_log off;
    }
    

    }

    
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
  • ¥30 3天&7天&&15天&销量如何统计同一行
  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)