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 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题