看板 Linux 關於我們 聯絡資訊
小弟環境是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
hn12404988: 有沒有可能是有別的web server也在運行?apache? 12/29 14:38
cerebellum: 你有指定server_name嗎? 12/29 14:55
phoenixcx: server_name .ptt.com 12/29 16:23
phoenixcx: 沒有apache 12/29 16:23
a34021501: CentOS不知道有沒有和ubuntu一樣long-term support版本 12/29 18:26
a34021501: Kernel Version????????????????????????????????????? 12/29 18:27
wsokwj: 修改www.conf 12/29 18:29
wsokwj: listen=/var/run/php-fpm/php-fpm.sock 12/29 18:29
wsokwj: user=nginx 12/29 18:29
wsokwj: group=nginx 12/29 18:29
wsokwj: listen.owner=nginx 12/29 18:29
wsokwj: listen.group=nginx 12/29 18:29
wsokwj: listen.mode=0660 12/29 18:29
sasoric: 問題應該是在外層的server設定,方便貼完整的conf嗎? 12/29 19:02
kenduest: centos 本身就是 long-term support 的版本啊... 12/29 21:23
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
phoenixcx: 另外www.conf設定是一樣的 12/30 10:59
pizzahut: 你test.ptt.com可以正常解到192.168.1.1吼 12/30 11:42
phoenixcx: 其實我指向過內網IP 還是一樣 所以現在我是指外網IP 12/30 12:58
sasoric: 把server_name整個拿掉試試 01/05 20:53
obitop2012: root 路徑不要用域名看看 03/13 20:38