httpsでnginxサイトにアクセスすると機能しますが、httpでは「download」というファイルをダウンロードし(拡張子はまったくありません)、57バイトでメモ帳などで開くと、意味不明な内容が表示されます。
これが私の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
▒▒
この設定はOKです。nginxを再構成したか、ファイアウォールを構成したか、その他何かを確認してください
—
Alexey Ten
また、確認してください
—
アレクセイテン
curl -v http://domain.com
返信ありがとうございます。私は何度か再起動しました(構成の一部を変更しようとしましたが、何の助けもありませんでした)、ファイアウォールも大丈夫です。curlで確認すると、奇妙な応答が返されます。▒▒これだけ-httpsのようにソースコードが表示されません。
—
rzmpl 2016年
phpfpmが稼働中で、ソケットが/run/php/php7.0-fpm.sockに存在している必要があります。
—
Farhan、2016年
します。PHPは動作します-PHPの問題ではないと思います。phpであるかどうかに関係なく、HTTPS上のすべてが機能します。しかし、http://またはドメインのみ(この場合はhttpsにリダイレクトする必要があります)と入力すると、「ダウンロード」という57バイトの小さなファイルがダウンロードされます。Nginxerror.logにも何も表示されません。
—
rzmpl 2016年