WebFaction
Community site: login faq

I wish to enable SSL on my site but allow users to access most of the pages without https (so as to spare them an unnecessary redirect). Will I need to create two websites in my.webfaction.com and point them both at the same application? (When I try to enable SSL on my website, it rewrites all domains for that site to https.)

If not, what are the steps that I must take to configure the change I want?

TMI: (I'm running a Rails app on Nginx with Passenger)

asked 09 Aug '12, 13:58

TwitTheKnife
27310
accept rate: 0%

edited 09 Aug '12, 13:58


Yes, you need two websites, one for HTTP and one for HTTPS.

You can use rewrite directives in your nginx.conf to force whichever protocol you need for whichever URLs.

Hope that helps!

permanent link

answered 09 Aug '12, 14:33

seanf
12.2k31836
accept rate: 37%

Should the listening port on HTTPS be 443? I see that the current server config file is NOT set to listen on 80 but on some other port. (I'd upvote at this point, but I don't have enough rep.)

(09 Aug '12, 14:46) TwitTheKnife

No, your app should listen on whatever port its been assigned in the control panel. Our front-end proxy listens on 80 and 443 and passes requests to your back-end server on its assigned port.

Regarding minimum rep for upvotes, you can gain rep by accepting the answer to your question (by clicking the check mark).

(09 Aug '12, 15:54) seanf

Ah, so in my nginx config file, I only need one virutal host (i.e. server{} block) set up, and it should handle both of the 'websites'?

(09 Aug '12, 17:12) TwitTheKnife

Yes, you should only need one virtual host in your nginx config.

(09 Aug '12, 17:17) seanf
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:

×93
×73

question asked: 09 Aug '12, 13:58

question was seen: 2,188 times

last updated: 09 Aug '12, 17:17

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 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