Ubuntu,Ngin在rails应用程序中的奇怪重定向

时间:2014-03-08 21:02:27

标签: ruby-on-rails apache ubuntu nginx

我不知道发生了什么,但我有一个运行nginx(端口8000)和apache(端口80)的ubuntu服务器,两者都指向相同的代码库(一个rails应用程序)。我打算切换到nginx但是想先测试一下。当我转到我的IP地址:8000我得到标准的nginx欢迎页面。当我去我的rails应用程序(thescotchcabi.net:8000)时,我得到了这个奇怪的页面,似乎来自voodoo.com!?!这是我的nginx日志

71.232.176.149 - - [08/Mar/2014:15:57:16 -0500] "GET / HTTP/1.1" 200 449 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36"
71.232.176.149 - - [08/Mar/2014:15:57:17 -0500] "GET /bh.php?dm=thescotchcabi.net&kw=the%20scot%20chc%20abi&tt=dcd95b9c6c601e02013b545d1283984d&ty=false HTTP/1.1" 200 906 "http://www.thescotchcabi.net:8000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36"
71.232.176.149 - - [08/Mar/2014:15:57:17 -0500] "GET /cf.php HTTP/1.1" 200 2051 "http://www.thescotchcabi.net:8000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36"
71.232.176.149 - - [08/Mar/2014:15:57:17 -0500] "GET /cf.php HTTP/1.1" 200 2051 "http://www.thescotchcabi.net:8000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36"
71.232.176.149 - - [08/Mar/2014:15:57:17 -0500] "GET /status.php?tadb=true&domain=thescotchcabi.net HTTP/1.1" 200 38 "http://www.thescotchcabi.net:8000/bh.php?dm=thescotchcabi.net&kw=the%20scot%20chc%20abi&tt=dcd95b9c6c601e02013b545d1283984d&ty=false" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36"
71.232.176.149 - - [08/Mar/2014:15:57:18 -0500] "GET /style/960.css HTTP/1.1" 200 893 "http://www.thescotchcabi.net:8000/cf.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36"

现在我的第一个想法是看看这些文件在系统中的位置:

find / -name 'bh.php'

但我一无所获。因此,似乎我的服务器以某种方式提供远程文件。这是我的nginx conf:

server {

            listen 8000 default_server deferred;
            root /var/www/scotchapp/current/public;
            server_name thescotchcabi.net www.thescotchcabi.net;
            index index.htm index.html;

            location ^~ /assets/ {
                    gzip_static on;
                    expires max;
                    add_header Cache-Control public;
            }

            try_files $uri/index.html $uri @unicorn;
            location @unicorn {
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header Host $http_host;
                    proxy_redirect off;
                    proxy_pass http://unicorn;
            }

            error_page 500 502 503 504 /500.html;
            client_max_body_size 20M;
            keepalive_timeout 10;
    }

您可以查看并比较scotchcabi.net和thescotchcabi.net:8000。我真的不明白这是怎么回事。

由于

编辑:我还发现这个网站http://urlquery.net/report.php?id=9782298显示了一些相同资产的调用并且似乎是相关的

编辑:这也是netstat的输出。端口8000正在运行。

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 localhost:59231         *:*                     LISTEN      32092/erinmadore
tcp        0      0 *:8000                  *:*                     LISTEN      -
tcp        0      0 *:imaps                 *:*                     LISTEN      -
tcp        0      0 localhost:43715         *:*                     LISTEN      31372/joshuawilcox
tcp        0      0 *:pop3s                 *:*                     LISTEN      -
tcp        0      0 *:8100                  *:*                     LISTEN      -
tcp        0      0 localhost:9000          *:*                     LISTEN      -
tcp        0      0 localhost:mysql         *:*                     LISTEN      -
tcp        0      0 *:submission            *:*                     LISTEN      -
tcp        0      0 *:pop3                  *:*                     LISTEN      -
tcp        0      0 *:imap2                 *:*                     LISTEN      -
tcp        0      0 *:http                  *:*                     LISTEN      -
tcp        0      0 *:ssh                   *:*                     LISTEN      -
tcp        0      0 localhost:postgresql    *:*                     LISTEN      -
tcp        0      0 *:smtp                  *:*                     LISTEN      -
tcp        0      0 localhost:postgresql    localhost:50607         ESTABLISHED -
tcp        0      0 localhost:50607         localhost:postgresql    ESTABLISHED 31372/joshuawilcox
tcp        0      0 localhost:postgresql    localhost:48774         ESTABLISHED -
tcp        0      0 joshuawilcox.net:imaps  c-71-232-176-149.:38385 ESTABLISHED -
tcp        0      0 joshuawilcox.net:http   static.135.77.63.:54303 TIME_WAIT   -
tcp        0      0 joshuawilcox.net:imap2  c-71-232-176-149.:35784 ESTABLISHED 863/imap
tcp        0      0 localhost:48775         localhost:postgresql    ESTABLISHED 29189/unicorn.rb -E
tcp        0    672 joshuawilcox.net:ssh    c-71-232-176-149.:45730 ESTABLISHED -
tcp        0      0 localhost:48774         localhost:postgresql    ESTABLISHED     29191/unicorn.rb -E
tcp        0      0 joshuawilcox.net:imaps  c-71-232-176-149.:36705 ESTABLISHED -
tcp        0      0 joshuawilcox.net:imap2  c-71-232-176-149.:35721 ESTABLISHED 450/imap
tcp        0      0 localhost:postgresql    localhost:48775         ESTABLISHED -
tcp6       0      0 [::]:imaps              [::]:*                  LISTEN      -
tcp6       0      0 [::]:pop3s              [::]:*                  LISTEN      -
tcp6       0      0 [::]:submission         [::]:*                  LISTEN      -
tcp6       0      0 [::]:pop3               [::]:*                  LISTEN      -
tcp6       0      0 [::]:imap2              [::]:*                  LISTEN      -
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      -
tcp6       0      0 [::]:smtp               [::]:*                  LISTEN      -

0 个答案:

没有答案