实在找不到解决方法了,google就那一篇文章在好几个地方也不知道谁抄的谁的,关键你抄袭就罢了管用也行啊还不管用:
感觉我遇到的和这个问题里的答案是一样的:
https://segmentfault.com/q/10...
但是这个问题有答主说和ssl无关,那么我访问http的1.php(正常访问)和https的1.php(直接下载)分别如下:
我又访问其他php文件http正常打开:
https直接下载:
环境是amh4.2的nginx,证书是在腾讯云申请的DV证书,nginx.conf的ssl配置如下:
server { listen 443; server_name www.choosek.net; ssl on; ssl_certificate 1_www.choosek.net_bundle.crt; ssl_certificate_key 2_www.choosek.net.key; ssl_session_timeout 5m; ssl_protocols TLSv1; ssl_ciphersHIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { root /home/wwwroot/choosek.net/web; indexindex.html index.htm; } }
把ssl配置改为:
server { listen 443; server_name www.w00yun.top; ssl on; ssl_certificate 1_www.w00yun.top_bundle.crt; ssl_certificate_key 2_www.w00yun.top.key; ssl_session_timeout 5m; ssl_protocols TLSv1; ssl_ciphersHIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on;location / { root /home/wwwroot/w00yun.top/web; indexindex.html index.htm优艾设计网_Photoshop交流 index.php; }location ~ .*.php$ { fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fcgi.conf; }location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$ { expires30d; }location ~ .*.(js|css)?$ { expires12h; }}
https访问1.php(phpinfo)由下载变成了如下:
但是访问之前的index.php还是直接下载:
想问一下到底是哪里的原因呢?
精彩评论