• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Can't see original apache response using curl -lv mydomain.com:7080

  • Thread starter Deleted member 209767
  • Start date
D

Deleted member 209767

Guest
Server operating system version
Linux
Plesk version and microupdate number
Plesk
I run apache/nginx proxy mode and I need to see the original response from apache using :
curl -lv https://www.mydomain.com:7080

I added this to etc/hosts
127.0.0.1 mydomain.com
127.0.0.1 www.mydomain.com

but I always get 404 error

[root@ns508279 ~]# curl -lv http://www.mydomain.com:7080/template/test.html
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to www.mydomain.com (127.0.0.1) port 7080 (#0)
> GET /template/test.html HTTP/1.1
> Host: www.mydomain.com:7080
> User-Agent: curl/7.61.1
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Sun, 08 May 2022 16:56:29 GMT
< Server: Apache
< Content-Length: 196
< Content-Type: text/html; charset=iso-8859-1
<
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
</body></html>
 
Hi,

With my server IP i was getting 301 moved permanently. I found the solution. It was because the option to redirect HTTP to https was enabled in Plesk

But I have another question

[root@ns508279 ~]# curl -lv http://www.mydomain.com:7080/somefile.webp
* Trying 167.114.64.16...
* TCP_NODELAY set
* Connected to www.mydomain.com (167.114.64.16) port 7080 (#0)
> GET /somefile.webp HTTP/1.1
> Host: www.mydomain.com:7080
> User-Agent: curl/7.61.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Wed, 11 May 2022 05:08:18 GMT
< Server: Apache
< Link: <http://www.mydomain.com:7080/somefile.png>; rel="canonical"
< Accept-Ranges: bytes
< Connection: Keep-Alive
< Expires: Thu, 11 May 2023 05:08:18 GMT
< Cache-Control: max-age=31536000
< Etag: W/"0"
< Last-Modified: Wed, 11 May 2022 05:08:18 GMT
< X-Original-Content-Length: 3438
< Content-Length: 3222
< Vary: Accept-Encoding
< Content-Type: image/webp

The rel=canonical header is lost when nginx proxy the request from apache. When looking at the header response from nginx, there is no rel=canonical. Why?
 
not sure what is your expectation.

I've added custom apache directives like below:
<Directory "/">
Header set rel canonical
<FilesMatch ".*">
Header set rel incanonical
</FilesMatch>
</Directory>
after invoking curl testdomain.tld:7080 -v i get a responce like below:
* Rebuilt URL to: testdomain.tld:7080/
* Trying 10.52.64.180...
* TCP_NODELAY set
* Connected to testdomain.tld (10.52.64.180) port 7080 (#0)
> GET / HTTP/1.1
> Host: testdomain.tld:7080
> User-Agent: curl/7.61.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 12 May 2022 02:57:24 GMT
< Server: Apache
< Last-Modified: Thu, 12 May 2022 02:47:02 GMT
< ETag: "87-5dec7928c4db4"
< Accept-Ranges: bytes
< Content-Length: 135
< rel: incanonical
< Content-Type: text/html
<
<html>
<head>
<title>small index file 64-180</title>
</head>
<body>
<div align=center>Hello world</div>
</body>
</html>
* Connection #0 to host testdomain.tld left intact

the same but with nginx:
]# curl testdomain.tld -v
* Rebuilt URL to: testdomain.tld/
* Trying 10.52.64.180...
* TCP_NODELAY set
* Connected to testdomain.tld (10.52.64.180) port 80 (#0)
> GET / HTTP/1.1
> Host: testdomain.tld
> User-Agent: curl/7.61.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Thu, 12 May 2022 02:59:06 GMT
< Content-Type: text/html
< Content-Length: 135
< Connection: keep-alive
< X-Accel-Version: 0.01
< Last-Modified: Thu, 12 May 2022 02:47:02 GMT
< ETag: "87-5dec7928c4db4"
< Accept-Ranges: bytes
< rel: incanonical
< X-Powered-By: PleskLin
<
<html>
<head>
<title>small index file 64-180</title>
</head>
<body>
<div align=center>Hello world</div>
</body>
</html>
* Connection #0 to host testdomain.tld left intact
as you can see, in my case custom tag "rel" passed in response.
 
Back
Top