歡迎您光臨本站 註冊首頁

關於nginx遇到的問題

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

關於nginx遇到的問題

今天搭建NGINX(編譯安裝) 利用squid和apache實現靜態又squid處理,動態頁面由apache處理
但是在啟動nginx的時候出現問題如下:
/usr/local/nginx/sbin/nginx -t
2010/06/19 07:16:36 26649#0: unknown directive "if" in /usr/local/nginx//conf/nginx.conf:53
2010/06/19 07:16:36 26649#0: the configuration file /usr/local/nginx//conf/nginx.conf test failed
一下是nginx的配置文件
    #keepalive_timeout  0;
    keepalive_timeout  65;

    upstream squids.com {
              server 192.168.2.4:80;
}
        upstream apaches.com {
              server 192.168.2.3:80;
              server 192.168.2.2:80;
}
    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
         if ($request_uri ~* ".*\.(html|bmp)$") {
        proxy_pass http://squids.com;
        }
         proxy_pass http://apaches.com;
        }
希望高手能幫我解決一下這個問題!謝謝
《解決方案》

directive "if" in /usr/local/nginx//conf/nginx.conf:53

語法有問題,樓主檢查下
《解決方案》

我認真看了語法的問題,由於初學很多不懂,希望高手們指教一下 謝謝

[火星人 ] 關於nginx遇到的問題已經有354次圍觀

http://coctec.com/docs/service/show-post-5600.html