Skip to content

Instantly share code, notes, and snippets.

@joakimk
Created March 31, 2012 20:35

Revisions

  1. joakimk revised this gist Mar 31, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    server {
    listen 443;
    server_name somewhere.com;
    server_name example.com;

    ssl on;
    ssl_certificate ssl.crt;
  2. joakimk created this gist Mar 31, 2012.
    7 changes: 7 additions & 0 deletions config.ru
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    require 'faye'

    Faye::WebSocket.load_adapter('thin')
    use Faye::RackAdapter, :mount => '/faye', :timeout => 25

    require ::File.expand_path('../config/environment', __FILE__)
    run App::Application
    7 changes: 7 additions & 0 deletions faye.js.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    faye_url = "#{window.location.protocol}//#{window.location.host}/faye"
    faye = new Faye.Client(faye_url)

    # We need to disable both of these to get faye to use long-polling
    faye.disable('websocket')
    faye.disable('eventsource')

    19 changes: 19 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    server {
    listen 443;
    server_name somewhere.com;

    ssl on;
    ssl_certificate ssl.crt;
    ssl_certificate_key ssl.key;
    ssl_session_timeout 5m;

    ssl_protocols SSLv2 SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

    location / {
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/htpass;
    proxy_pass http://127.0.0.1:4488;
    }
    }
    1 change: 1 addition & 0 deletions start_command.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    bundle exec thin start -p 4488