nginx的php讀取問題 - Linux

By Bennie
at 2016-12-29T13:25
at 2016-12-29T13:25
Table of Contents
小弟環境是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;
}
請問該如何是好 感謝各位!
--
如果是指定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;
}
請問該如何是好 感謝各位!
--
Tags:
Linux
All Comments

By Connor
at 2016-12-31T03:58
at 2016-12-31T03:58

By Una
at 2016-12-31T06:29
at 2016-12-31T06:29

By Agatha
at 2017-01-02T19:55
at 2017-01-02T19:55

By Olivia
at 2017-01-04T09:39
at 2017-01-04T09:39

By Carolina Franco
at 2017-01-07T12:56
at 2017-01-07T12:56

By Vanessa
at 2017-01-09T16:14
at 2017-01-09T16:14

By Olivia
at 2017-01-12T20:04
at 2017-01-12T20:04

By Leila
at 2017-01-14T02:41
at 2017-01-14T02:41

By Tristan Cohan
at 2017-01-15T21:11
at 2017-01-15T21:11

By Ingrid
at 2017-01-20T03:38
at 2017-01-20T03:38

By Carol
at 2017-01-24T05:52
at 2017-01-24T05:52

By Anthony
at 2017-01-25T18:57
at 2017-01-25T18:57

By Olga
at 2017-01-27T09:23
at 2017-01-27T09:23
Related Posts
AMD RX470 HDMI audio 輸出

By Poppy
at 2016-12-28T21:33
at 2016-12-28T21:33
r+hadoop中rmr/rhdfs問題

By Bennie
at 2016-12-27T22:47
at 2016-12-27T22:47
裝linux mint18.0會讓win10有線網卡失效?

By Faithe
at 2016-12-27T21:48
at 2016-12-27T21:48
libvirt + qemu

By Andrew
at 2016-12-27T10:43
at 2016-12-27T10:43
為什麼符號連結會多一個inode&block?

By Mary
at 2016-12-26T13:58
at 2016-12-26T13:58