• 我该不该走 at 2017年04月29日

    及时止损。说出承诺不兑现的人,不值得跟随。你的老板没有跟你一起工作的诚意

  • 家里的网,不能推导出,家里的网络很好,更不能推导出,这个问题不是由于网络原因而产生的。

    使用rubygens官方源需要翻墙才能避免你的电脑到达国外官方源的网络时好时坏, 替换https 为http ,可以让你访问rubychina的源不会因为https的问题而无法访问。

    此外,其他的网络的问题各有不同,你需要找到具体的问题相对应的解决方案才可。不能因为家里的网'好',而做出错误的判断 额外建议,最好升级一下gem http://gems.ruby-china.org/

  • 实现一个代码补全的思路 at 2017年01月02日

    如果某个类型include的module非常多,而且还引入另一个文件的类呢

  • 刚花100多块钱,买了3年的的 cheapssl 哀伤😭

  • #9楼 @starshine 非80端口不清楚。不过我知道你的配置肯定缺少proxy_set_header X-Forwarded-Proto https,楼主多尝试,成功后求分享经验

  • 楼主参考这个网页的设置,关键点是 proxy_set_header X-Forwarded-Proto https; https://www.digitalocean.com/community/questions/error-too-many-redirect-on-nginx

    I just had the exact same problem after enabling SSL. The issue for me was I have Rails set to config.force_ssl = true which relies on the proxy_set_header X-Forwarded-Proto https; header to know whether the request was over SSL or not. I didn't have that header to Rails would receive an SSL request thinking it wasn't with SSL which caused it to redirect to https.

    Here's my working config:

    upstream puma {
      server unix:///home/deploy/apps/genus/shared/tmp/sockets/genus-puma.sock;
    }
    
    server {
      listen 80;
      listen 443 ssl;
      server_name genusapp.com;
    
      ssl_certificate /home/deploy/apps/genus/genusapp_com.pem;
      ssl_certificate_key /home/deploy/apps/genus/genusapp_com.key;
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      ssl_prefer_server_ciphers on;
      ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
    
    
      root /home/deploy/apps/genus/current/public;
      access_log /home/deploy/apps/genus/current/log/nginx.access.log;
      error_log /home/deploy/apps/genus/current/log/nginx.error.log info;
    
      location ^~ /assets/ {
        gzip_static on;
        expires max;
        add_header Cache-Control public;
      }
    
      try_files $uri/index.html $uri @puma;
      location @puma {
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
    
        proxy_pass http://puma;
      }
    
      error_page 500 502 503 504 /500.html;
      client_max_body_size 10M;
      keepalive_timeout 10;
    }
    
  • 支持楼主,郑州rails加油

  • 放到config/initialize 文件夹,即可

  • 我一般需要命令行翻墙的时候会设置全局翻墙,就搞定了

  • nginx 的配置文件,里面有个tryfile,你搜索下它的意思。调整一下$uri/index的位置,或删除它,估计可以解决你的问题

前Qt程序员,现rails新手