小弟環境是Centos 7
如果是指定ip: http://192.168.1.1/test.php 可以讀取
但如果用網域就會讓你下載 http://test.ptt.com/test.php
location ~ \.php$ {
root /vhost/test.ptt.com/htdocs;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
try_files $uri =404;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
請問該如何是好 感謝各位!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 59.124.92.194
※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1482989126.A.C3D.html
推
12/29 14:38, , 1F
12/29 14:38, 1F
推
12/29 14:55, , 2F
12/29 14:55, 2F
→
12/29 16:23, , 3F
12/29 16:23, 3F
→
12/29 16:23, , 4F
12/29 16:23, 4F
推
12/29 18:26, , 5F
12/29 18:26, 5F
→
12/29 18:27, , 6F
12/29 18:27, 6F
→
12/29 18:29, , 7F
12/29 18:29, 7F
→
12/29 18:29, , 8F
12/29 18:29, 8F
→
12/29 18:29, , 9F
12/29 18:29, 9F
→
12/29 18:29, , 10F
12/29 18:29, 10F
→
12/29 18:29, , 11F
12/29 18:29, 11F
→
12/29 18:29, , 12F
12/29 18:29, 12F
→
12/29 18:29, , 13F
12/29 18:29, 13F
→
12/29 19:02, , 14F
12/29 19:02, 14F
→
12/29 21:23, , 15F
12/29 21:23, 15F
ssl_certificate /etc/nginx/certs/2015/test.pem;
ssl_certificate_key /etc/nginx/certs/2015/test.key;
ssl_session_timeout 2m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "HIGH:!aNULL:!MD5";
ssl_dhparam /etc/nginx/certs/2015/test-dh.pem;
server {
listen 80;
listen 443 ssl;
#server_name localhost;
server_name test.ptt.com, 192.168.1.1;
#charset koi8-r;
access_log /var/log/nginx/host.access.log main;
location / {
root /vhost/test.ptt.com/htdocs;
index index.php index.html index.htm;
autoindex off;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
root /vhost/test.ptt.com/htdocs;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
try_files $uri =404;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
還是說需要www.conf??
※ 編輯: phoenixcx (59.124.92.194), 12/30/2016 10:58:43
→
12/30 10:59, , 16F
12/30 10:59, 16F
→
12/30 11:42, , 17F
12/30 11:42, 17F
→
12/30 12:58, , 18F
12/30 12:58, 18F
→
01/05 20:53, , 19F
01/05 20:53, 19F
→
03/13 20:38, , 20F
03/13 20:38, 20F