si je visite mon site nginx avec https, cela fonctionne, mais avec http, il télécharge un fichier appelé "download" (aucune extension que ce soit), 57 octets et l'ouvre avec le bloc-notes, etc. montre juste du charabia.
Voici ma configuration vhost:
server {
server_name www.domain.com domain.com;
listen 80;
return 301 https://domain.com$request_uri;
}
server {
server_name www.domain.com
listen 443 ssl;
/* SSL Stuff */
return 301 https://domain.com$request_uri;
}
server {
server_name domain.com;
index index.php index.html index.htm;
listen 443 ssl;
root /usr/share/nginx/domain.com;
/* SSL Stuff */
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\. {
deny all;
}
}
curl-v:
curl -v http:/domain.com *
Rebuilt URL to: http://domain.com/ *
Hostname was NOT found in DNS cache *
Trying 175.*.*.*... *
Connected to domain.com (175.*:*:*) port 80 (#0)
> GET / HTTP/1.1 > User-Agent: curl/7.38.0
> Host: domain.com > Accept: */*
> * Connection #0 to host domain.com left intact
▒▒
curl -v http://domain.com