15 nginx
如果我使用 https 访问我的 nginx 站点,它正在工作,但是使用 http 它正在下载一个名为“下载”(没有任何扩展名)的文件,57 个字节并用记事本等打开它只会显示乱码。
这是我的虚拟主机配置:
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;
}
}
Run Code Online (Sandbox Code Playgroud)
卷曲-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
??
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6909 次 |
最近记录: |