【问题标题】:Nginx and Varnish only serving up welcome pageNginx 和 Varnish 只提供欢迎页面
【发布时间】:2013-05-11 13:11:51
【问题描述】:

我已经在新的 Ubuntu 12.04 服务器上安装并配置了 Nginx 和 varnish。将 Nginx 升级到 1.4.1 后,我不得不更新一些配置设置。现在我只看到 Nginx “欢迎使用 nginx!”页面。

请注意,在我们将 DNS 设置更新到新服务器之前,我必须通过直接 IP 地址访问此站点,不确定这是否重要。

这是我的配置:

Nginx 默认,/etc/nginx/sites-available/default:

server {
    listen 81 default_server;
    listen [::]:81 default_server ipv6only=on;

    root /home/website/public_html;
    index index.html index.htm index.php;

    # Make site accessible from http://localhost/
    server_name 111.111.11.11; #Server IP here

清漆默​​认VCL,etc/varnish/default.vcl

backend default {
    .host = "127.0.0.1";
    .port = "81";
    .connect_timeout = 5s;
    .first_byte_timeout = 10s;
    .between_bytes_timeout = 10s;
}

清漆,/etc/default/varnish

DAEMON_OPTS="-a :80 \
             -T localhost:6082 \
             -f /etc/varnish/default.vcl \
             -S /etc/varnish/secret \
             -s malloc,1G"

【问题讨论】:

    标签: nginx varnish varnish-vcl


    【解决方案1】:

    事实证明我的配置很好,我只是在 Nginx 的默认文件中注释掉了我的 FastCBI 服务器部分。我取消了以下注释,一切就绪。

    location ~ \.php$ {
        #try_files $uri =404;
        #fastcgi_split_path_info ^(.+\.php)(/.+)$;
        # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    
        # With php5-cgi alone:
        #fastcgi_pass 127.0.0.1:9000;
        # With php5-fpm:
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-23
      • 2023-03-14
      • 2018-01-24
      • 2012-02-05
      • 2019-12-09
      相关资源
      最近更新 更多