Redirect Error - Special character download
October 11, 2019 06:03AM
Hi to all,

I've install iRedMail software over a new VPS with CentOS 7.7 x64.
The scope of that server is manage mail from 3 domain (magri.email, sempai.it and zulberti.it).
Additional, i'd like to have 3 website (magri.email, sempai.it and zulberti.it) for each root folder under /var/www/html/
I've generate for each domain the following conf file under /etc/nginx/sites-available (and symbolyc lik under sites-enable) with that configuration :

server {
listen 80 http2;
listen [::]:80 http2;
server_name www.magri.email;
return 301 https://$host$request_uri;
}
server {
listen 80 http2;
listen [::]:80 http2;
server_name magri.email;
return 301 https://www.$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name magri.email;
return 301 https://www.magri.email$request_uri;
include /etc/nginx/templates/ssl.tmpl;
include /etc/nginx/templates/hsts.tmpl;
include /etc/nginx/templates/php_catchall.tmpl;
include /etc/nginx/templates/misc.tmpl;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.magri.email;
root /var/www/html/magri.email;
index index.php index.html index.htm;
include /etc/nginx/templates/ssl.tmpl;
include /etc/nginx/templates/hsts.tmpl;
include /etc/nginx/templates/php_catchall.tmpl;
include /etc/nginx/templates/misc.tmpl;
}

If i do a check with curl or firefox/chrome or other browser with https it work fine.
Redirect work successfully :

[root@srv-main sites-available]# curl -I https://magri.email
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Fri, 11 Oct 2019 10:01:57 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://www.magri.email/
Strict-Transport-Security: max-age=63072000

[root@srv-main sites-available]# curl -I https://www.magri.email
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 11 Oct 2019 10:02:02 GMT
Content-Type: text/html
Content-Length: 770
Last-Modified: Wed, 09 Oct 2019 23:26:53 GMT
Connection: keep-alive
ETag: "5d9e6cbd-302"
Strict-Transport-Security: max-age=63072000
Accept-Ranges: bytes

If i do the same check with HTTP over curl i've the following error output :

[root@srv-main sites-available]# curl -I http://magri.email
▒▒[root@srv-main sites-available]# xterm-256color
-bash: xterm-256color: command not found
[root@srv-main sites-available]# curl -I http://www.magri.email
▒▒[root@srv-main sites-available]# xterm-256color
-bash: xterm-256color: command not found

As you can see it try to print a special characther instead redirect over HTTPS.
From the browser start a file download.

How i can solve that problem :-( ?

Thanks for your support.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 220
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready