我有一个只能通过https访问的网站

时间:2017-10-30 19:26:49

标签: ruby-on-rails node.js apache certbot

我有一个在8080端口上运行的apache / RoR服务器和从端口80转发的redbird(因为我在同一台机器上运行了一个nodejs网站)。问题是,当我尝试从http连接我的RoR网站时,它给我500错误或GET失败。下面是我的apache设置。

<VirtualHost *:8080>
        DocumentRoot /home/ffit/gsatech/production/current/public
        ServerName cobranca.gsatech.com.br
        ServerAlias www.cobranca.gsatech.com.br

        RailsEnv production

        <Directory "/home/ffit/gsatech/production/current/public">
                #Options -MultiViews
                #Allow from all
                Options Indexes FollowSymLinks
                Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error-gsatech-production.log
        CustomLog ${APACHE_LOG_DIR}/access-gsatech-production.log combined
        PassengerRuby /usr/share/rvm/gems/ruby-2.1.5/wrappers/ruby

        LoadModule passenger_module /usr/share/rvm/gems/ruby-2.1.5/gems/passenger-5.1.8/buildout/apache2/mod_passenger.so
        <IfModule mod_passenger.c>
        PassengerRoot /usr/share/rvm/gems/ruby-2.1.5/gems/passenger-5.1.8
        PassengerDefaultRuby /usr/share/rvm/gems/ruby-2.1.5/wrappers/ruby
        </IfModule>

#RewriteEngine on
#RewriteCond %{SERVER_NAME} =cobranca.gsatech.com.br
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
RewriteEngine on
RewriteCond %{SERVER_NAME} =cobranca.gsatech.com.br [OR]
RewriteCond %{SERVER_NAME} =www.cobranca.gsatech.com.br
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

这是我的app.js,用于我的redbird转发到apache。

var proxy = require('redbird')({port: 80, xfwd: false});

proxy.register("dicoop.ffit.com.br", "http://dicoop.ffit.com.br:3030");

proxy.register("http://cobranca.gsatech.com.br", "https://cobranca.gsatech.com.br:8080");

proxy.register("www.cobranca.gsatech.com.br", "https://cobranca.gsatech.com.br:8080");

Apache运行端口81,而我的Redbird模块在端口80上运行,通过我的网站进行路由,并且我有一个certbot为我的RoR网站执行我的https证书。

0 个答案:

没有答案