VPS侦探论坛

 找回密码
 注册
查看: 7012|回复: 2

nginx配置ssl问题

[复制链接]
发表于 2011-1-26 15:22:14 | 显示全部楼层 |阅读模式

看军哥的https://www.vpser.net/manage/namecheap-free-ssl-nginx.html这篇文章学习在nginx下设置ssl,按照军哥的教程配置的nginx.conf,
但是现在用ssl访问貌似只能显示静态网页,一碰到动态php文件就提示No input file specified.
求解


我的nginx.conf代码
  1. server {
  2.         listen       443;
  3.         server_name  www.abc123.com

  4.         ssl                  on;
  5.         ssl_certificate      ssl.pem;
  6.         ssl_certificate_key ssl.key;

  7.         ssl_session_timeout  5m;

  8.         ssl_protocols  SSLv2 SSLv3 TLSv1;
  9.         ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
  10.         ssl_prefer_server_ciphers   on;

  11.         location / {
  12.             root   /home/wwwroot;
  13.             index  index.html index.htm index.php;
  14.         }
  15.                 location ~ .*\.(php|php5)?$
  16.                 {
  17.                         fastcgi_pass  unix:/tmp/php-cgi.sock;
  18.                         fastcgi_index index.php;
  19.                         fastcgi_param  HTTPS on;
  20.                         include fcgi.conf;
  21.                 }
  22.                 access_log  off;
  23.     }
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-1-26 15:57:20 | 显示全部楼层

回复 1# 的帖子



首先确保root 所指向目录有该php文件。

把root   /home/wwwroot;
            index  index.html index.htm index.php;这上面的location / {  去掉,下面的}也去掉。

/usr/local/nginx/sbin/nginx -t 看一下,再/usr/local/nginx/sbin/nginx -s reload
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-1-26 17:44:10 | 显示全部楼层

回复 2# 的帖子


军哥V5  居然搞定了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-5-1 19:58 , Processed in 0.026027 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表