Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6869491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:33:51+00:00 2026-05-27T03:33:51+00:00

My stack looks like this nginx -> thin -> rails. In my rails app

  • 0

My stack looks like this nginx -> thin -> rails. In my rails app I have in my applicaton_controller.rb:

  if (!Rails.env.development?)
    before_filter :force_ssl
  end

  # Force logged in users to use SSL
  def force_ssl
    if current_user && request.protocol != "https://"
      redirect_to :protocol => "https://"
    end
  end

The problem is all requests seem like http since nginx handles the ssl and forwards to thin and causes an infinite redirect loop. What’s the proper way to set up ssl for logged in users in this situation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:33:52+00:00Added an answer on May 27, 2026 at 3:33 am

    You can use the proxy_set_header directive to set a custom header telling your backend that the request came from the secure frontend.

    Example:

    for 80:
    proxy_set_header           X-SSL     0;
    
    for 443:
    proxy_set_header           X-SSL     1;
    

    Or globally

    proxy_set_header X-Forwarded-Proto $scheme;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stack trace that looks like this: #3 0x00007fffde86c206 in GetMedia (p_ml=0xb91560,
It looks like we'll be adding CAPTCHA support to Stack Overflow. This is necessary
Okay, this is just a crazy idea I have. Stack Overflow looks very structured
I have a setup that looks like this. class Checker { // member data
I have data that looks like this: [{ level: 0, data: 'A', }, {
I am making a top menu, and it looks like this: https://i.stack.imgur.com/5O5G5.png The contact
I have data that looks like this: CUSTOMER_ID OPERDAYSJUL OPERDAYSAUG OPERDAYSSEP ... OPERDAYSJUN 1
I have a string that looks like this: 7-6-4-1 or 7 or That is,
I'd like to create a webpage which looks like this: https://i.stack.imgur.com/GYEis.png I can't use
i have a web.config file that looks like this: <?xml version=1.0?> <configuration> <system.web> <compilation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.