Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Curl 我想卷曲,但它重定向到localhost_Curl_Localhost - Fatal编程技术网

Curl 我想卷曲,但它重定向到localhost

Curl 我想卷曲,但它重定向到localhost,curl,localhost,Curl,Localhost,我想从我的服务器上卷曲我的网站,但它不是通过互联网,而是通过本地主机 我尝试过更改主机标题,但没有效果 curl'website.com/v1/auth?appid=123456&date=20191001123456'-k-v 它试图直接连接到127.0.0.1,我希望它能访问“website.com” 编辑:添加所指出的日志 * About to connect() to website.com port 80 (#0) * Trying 127.0.0.1... * Connected

我想从我的服务器上卷曲我的网站,但它不是通过互联网,而是通过本地主机

我尝试过更改主机标题,但没有效果

curl'website.com/v1/auth?appid=123456&date=20191001123456'-k-v

它试图直接连接到127.0.0.1,我希望它能访问“website.com”

编辑:添加所指出的日志

* About to connect() to website.com port 80 (#0)
*   Trying 127.0.0.1...
* Connected to website.com (127.0.0.1) port 80 (#0)
> GET /v1/auth?appid=123456&date=20191001123456 HTTP/1.1
> User-Agent: curl/7.29.0
> Accept: */*
> Host: website.com
>
< HTTP/1.1 200 OK
< Date: Tue, 22 Oct 2019 03:45:29 GMT
< Server: Apache
< Expires: Sat, 26 Jul 1997 05:00:00 GMT
< Last-Modified: Tue, 22 Oct 2019 03:45:30 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Cache-Control: post-check=0, pre-check=0
< Cache-Control: private
< Pragma: no-cache
< Content-Length: 61
< Connection: close
< Content-Type: application/json; charset=utf-8
<
* Closing connection 0
*即将连接()到website.com端口80(#0)
*正在尝试127.0.0.1。。。
*已连接到website.com(127.0.0.1)端口80(#0)
>GET/v1/auth?appid=123456&date=20191001123456 HTTP/1.1
>用户代理:curl/7.29.0
>接受:*/*
>主持人:website.com
>
您的curl似乎正在尝试连接到代理服务器,而不是直接连接到internet

通过命令env检查您的环境,并查看是否存在http\U代理

此外,请检查是否有一些调试工具,如Fiddler、TCPDump或Jmeter设置,因为它们可能会创建代理服务器


如果您发布curl-v结果,我可以帮您看一下。

为什么frick使用verbose(
-v
)而不向我们显示verbose日志?它可以保存关于它为什么会进入本地主机的重要信息。被否决。