WebFaction
Community site: login faq

I have installed my ssl certificates and added and I have my own nginx installed running so I added them to the .conf file. I have something like this

server {

    listen   14550 ssl;
    server_name localhost;
    client_max_body_size 4G;

    ssl_certificate /home/zanklord/caucab_com.pem;
    ssl_certificate_key /home/zanklord/caucab.key;

    access_log /home/zanklord/webapps/caucab/logs/nginx-access.log;
    error_log /home/zanklord/webapps/caucab/logs/nginx-error.log;

    location /static/ {
        alias   /home/zanklord/webapps/caucab_static/;
    }

    location /media/ {
        alias   /home/zanklord/webapps/caucab_media/;
    }

    location / {
        proxy_set_header X-Forwarded-Protocol $scheme;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        if (!-f $request_filename) {
            proxy_pass http://hello_app_server;
            break;
        }
    }

    # Error pages
    error_page 500 502 503 504 /500.html;
    location = /500.html {
        root /webapps/hello_django/static/;
    } }

and when I acces to it via https get the error in the title: "The plain HTTP request was sent to HTTPS port".

Also have another question: How I can make the standart http conections redirect to the https? At the moment when I try to enter via http got the not configured webfaction screen

asked 21 Nov '15, 15:47

zanklord
313
accept rate: 0%


Do you intend to handle SSL yourself on your Nginx instance?

WebFaction runs a front-end Nginx server which is the standard way to enable HTTPS. In that case, we install the certificates for you. This is covered in our documentation here.

When our front-end Nginx server strips the HTTPS layer, it proxies HTTP to your application. In this way, you can run SSL-secured websites without having to run an application server configured to handle HTTPS itself.

In your example, you are telling your Nginx instance to handle SSL, but generally by the time the request has gotten this far, the SSL layer has already been removed by the front-end Nginx server and the request is arriving as a normal HTTP request to your Nginx instance. If you do really want to manage SSL on your instance, then it would need to be listening on an open port in the firewall directly; that is, not on port 443.

As for redirecting HTTP to HTTPS, you'd use a normal redirect application. If you get the "Site Not Configured" webfaction screen, that means that you haven't created an HTTP website record. You need both HTTP and HTTPS website records at the same time; this is noted in the HTTPS documentation referenced above.

Hope that helps!

permanent link

answered 22 Nov '15, 02:54

ryans ♦♦
5.0k93260
accept rate: 43%

Yes helped me! Thank you was very useful this info, I was misunderstanding some things :)

(26 Nov '15, 16:01) zanklord
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×186

question asked: 21 Nov '15, 15:47

question was seen: 3,221 times

last updated: 26 Nov '15, 16:01

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM