出国看病www.auromcs.cn这个网站:
http下打开php文件正常,后来升级了https,配置如下,
http {
  include mime.types;
  default_type application/octet-stream;
  server_names_hash_bucket_size 128;
  client_header_buffer_size 32k;
  large_client_header_buffers 4 32k;
  client_max_body_size 1024m;
  client_body_buffer_size 10m;
  sendfile on;
  tcp_nopush on;
  keepalive_timeout 120;
  server_tokens off;
  tcp_nodelay on;  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_read_timeout 300;
  fastcgi_buffer_size 64k;
  fastcgi_buffers 4 64k;
  fastcgi_busy_buffers_size 128k;
  fastcgi_temp_file_write_size 128k;
  fastcgi_intercept_errors on;
 
  #Gzip Compression
  gzip on;
  gzip_buffers 16 8k;
  gzip_comp_level 6;
  gzip_http_version 1.1;
  gzip_min_length 256;
  gzip_proxied any;
  gzip_vary on;
  gzip_types
    text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml
    text/javascript application/javascript application/x-javascript
    text/x-json application/json application/x-web-app-manifest+json
    text/css text/plain text/x-component
    font/opentype application/x-font-ttf application/vnd.ms-fontobject
    image/x-icon;
  gzip_disable "MSIE [1-6]\.(?!.*SV1)";  #If you have a lot of static files to serve through Nginx then caching of the files' metadata (not the actual files' contents) can save some latency.
  open_file_cache max=1000 inactive=20s;
  open_file_cache_valid 30s;
  open_file_cache_min_uses 2;
  open_file_cache_errors on;######################## default ############################server {
    listen 443;
server_name www.auromcs.cn;
root /data/wwwroot/default;
    index index.html index.htm index.php;
    ssl on;
    ssl_certificate      /etc/nginx/server.crt;
    ssl_certificate_key  /etc/nginx/server.key;
   location ~ .*\.(php|php5)?$ {
            root           /data/wwwroot/default;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  HTTPS   on;
            include        fastcgi_params;
            include fastcgi.conf;        
        }
}server {  
    listen  80; 
    server_name www.auromcs.cn;
    rewrite ^(.*)$  https://$host$1 redirect;
}  ########################## vhost #############################
  include vhost/*.conf;
}
现在访问html、htm文件正常,打开主页的index.php就出现了502,求解决方案。

解决方案 »

  1.   

    贴出你的 nginx 错误日志
      

  2.   

    nginx启动没啥问题
      

  3.   

    看你的 php-fpm日志
    日志在 php-fpm.conf 里面配置的 error_log 的路径下
      

  4.   

    php-fpm日志已经没有新的记录,已经不记录日志了,可能是php-fpm出了问题。
      

  5.   

    php-fpm日志在变成https就不记录,是不是php-fpm不支持https
      

  6.   

    贴出你的 php-fpm.conf
      

  7.   

    php-fpm.conf 你是怎样写的
      

  8.   

    下面是成功的配置,你可以复制修改一下文件名路径等参数应该没问题(这里CA证书是文件验证方式是.pem和key文件)
    server {
        listen 80;
        listen 443 ssl;
    server_name  www.auromcs.cn;
       ssl_certificate   cert/你的.pem; 
       ssl_certificate_key cert/你的.key; 
       ssl_session_timeout 5m;
       ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
       ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
       ssl_prefer_server_ciphers on;   if ($scheme = http){return 301 https://$host$request_uri;}
        location / {
            root   /data/wwwroot/default;
            index  index.html index.php index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /data/wwwroot/default;
        }
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_param  SCRIPT_FILENAME  /data/wwwroot/default$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
      

  9.   

    参考这个解决方法:http://blog.csdn.net/a_haogg/article/details/72830734