ruby on rails - Nginx keeps redirecting to HTTPS for no apparent reason? -
i've set ubuntu vps , , running keep getting redirected https don't want.
this config:
/etc/nginx/nginx.conf
:
user www-data; worker_processes 4; pid /run/nginx.pid; events { worker_connections 768; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; ssl_protocols tlsv1 tlsv1.1 tlsv1.2; # dropping sslv3, ref: poodle ssl_prefer_server_ciphers on; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; gzip_disable "msie6"; passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini; passenger_ruby /home/deploy/.rvm/wrappers/ruby-2.3.0/ruby; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; }
/etc/nginx/sites-available/default
:
server { listen 80 default_server; server_name www.example.com localhost; passenger_enabled on; rails_env staging; root /home/deploy/example.com/current/public; error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
this output lynx example.com
:
looking example.com first looking example.com making http connection example.com sending http request. http request sent; waiting response. http/1.1 301 moved permanently data transfer complete http/1.1 301 moved permanently using https://example.com/ looking example.com making https connection example.com alert!: unable connect remote host. lynx: can't access startfile http://example.com/
/var/log/nginx/access.log
:
x.x.x.x - - [25/apr/2016:09:25:30 +0000] "get / http/1.0" 301 0 "-" "lynx/2.8.8rel.2 libwww-fm/2.14 ssl-mm/1.4.1 openssl/1.0.2g"
does know why keep getting redirected?
there configuration option in rails force use of ssl. try setting
config.force_ssl = false
Comments
Post a Comment