1

I've installed and configured Nginx and varnish on a new Ubuntu 12.04 server. After upgrading Nginx to 1.4.1, I had to update some configuration settings. Now I am only seeing the Nginx "Welcome to nginx!" page.

One note, I have to access this site via the direct IP address until we update our DNS settings to the new server, not sure if that matters.

Here are my configurations:

Nginx default, /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

Varnish default 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;
}

Varnish, /etc/default/varnish

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

1 回答 1

0

事实证明我的配置很好,我只是在 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;
}
于 2013-05-16T15:23:10.803 回答