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 9254787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:33:37+00:00 2026-06-18T11:33:37+00:00

I have SSL certification at the ELB level for my site hosted on Amazon.

  • 0

I have SSL certification at the ELB level for my site hosted on Amazon. I used the following site to setup a middle ware to forward all http requests to https:

http://djangosnippets.org/snippets/2472/

It’s working great. But here’s my question. EACH request is getting forwarded, so I notice a slight lag when clicking links, etc. Nothing extreme. But is there a way to force django to do everything via https? When I have code to HttpResponse and HttpResponseRedirect, how can I have it default to https instead of http? I tried to search for this and was unsuccessful…

I know it’s possible if I type https://www... for each URL for redirect and on the links for the pages, but I wanted to avoid doing it that way if possible.

  • 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-06-18T11:33:38+00:00Added an answer on June 18, 2026 at 11:33 am

    We use Nginx currently to load balance, force SSL on requests, and terminate SSL connections as they are proxied to internal app servers. It doesn’t have as fancy load balancing capabilities, but Nginx is small and fast enough to put anywhere.

    Here’s the code bits you may need:

    # listen on port 80 and redirect to SSL.
    server {
       listen         80;
       server_name    site.com;
       rewrite        ^ https://$server_name$request_uri? permanent;
    }
    
    # listen on port 443, terminate SSL, and proxy to internal web app
    # can be node, rails, whatever.
    server {
      listen 443;
      server_name  site.com;
      gzip  on;
      client_max_body_size 250M;
    
      ssl   on;
      ssl_certificate   /etc/nginx/site.com.crt;
      ssl_certificate_key  /etc/nginx/site.com.key;
      keepalive_timeout  70;
    
      location / {
        proxy_pass http://127.0.0.1:8080;
        # We add this extra header just so proxied web app
        # knows this used to be an SSL connection.
        proxy_set_header x-https 1;
        include /etc/nginx/conf.d/proxy.conf;
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ssl page that also downloads an avatar from a non-ssl site.
For testing purposes I have and SSL certificate set up on a dev site
I have setup Custom Domain https://developers.google.com/appengine/docs/domain I have uploaded An SSL certificate and private
I have ssl in my e-commerce web site. At first, browser always asking do
I have a web site using ssl certificate authentication. How to force the web
I have Apache2 SSL which is fronting Spring webapp as follows: ProxyPass / http://localhost:8080/
I have an Apache SSL connection available with a C# server that listens to
I have completed configuring SSL in my local Tomcat. And the exception was thrown
I have a very specific SSL issue on my Android. If I try to
We have not purchased an SSL certificate so the user of our website has

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.