[OpenSRF-GIT] OpenSRF branch master updated. 93da6fb07c8b613011028f577b55fa8ba940f1ee

Evergreen Git git at git.evergreen-ils.org
Wed Dec 7 12:54:32 EST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSRF".

The branch, master has been updated
       via  93da6fb07c8b613011028f577b55fa8ba940f1ee (commit)
       via  ededc269eacb9e69e30074bba2cff35a3148e62e (commit)
      from  a3b2a15f27709815155eb9dbb8026343000753d5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 93da6fb07c8b613011028f577b55fa8ba940f1ee
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Wed Dec 7 12:54:05 2016 -0500

    LP#1638651: add instructions for using NGINX
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/README b/README
index acdebd5..564093a 100644
--- a/README
+++ b/README
@@ -515,6 +515,64 @@ export OSRF_WEBSOCKET_MAX_REQUEST_WAIT_TIME=600
 /etc/init.d/apache2-websockets start
 ---------------------------------------------------------------------------
 
+Optional: Using NGINX as a proxy
+--------------------------------
+NGINX can be used to proxy HTTP, HTTPS, and WebSockets traffic. Among other
+reasons, this can be useful for Evergreen setups that want to have both
+HTTPS and secure WebSockets traffic both go through port 443 while using
+two Apache instances (one for the WebSockets gateway and one for the more
+memory-intensive TPAC pages).
+
+The following instructions are a guide for setting this up on Debian
+and Ubuntu systems, but expect general familiarity with various system
+administration and netwrok tasks.  The steps should be run as the *root*
+Linux account, and assume that you already followed the instructions
+for installing WebSockets support.
+
+1. Install NGINX if not already present:
++
+[source, bash]
+---------------------------------------------------------------------------
+apt-get install nginx
+---------------------------------------------------------------------------
++
+2. Configure the main Apache instance to listen on port 7080 for HTTP and
+   port 7443 for HTTPS and ensure that it is not listening on ports 80
+   and 443, then restart Apache.
+3. Copy the example NGINX configuration file into place.
++
+[source, bash]
+---------------------------------------------------------------------------
+cd /path/to/opensrf-OSRFVERSION
+cp examples/nginx/osrf-ws-http-proxy /etc/nginx/sites-available/
+ln -s /etc/nginx/sites-available/osrf-ws-http-proxy /etc/nginx/sites-enabled/osrf-ws-http-proxy
+---------------------------------------------------------------------------
++
+4. Edit `/etc/nginx/sites-available/osrf-ws-http-proxy` to set the location
+   of the SSL certificate and private key.
+5. Start NGINX
++
+[source, bash]
+---------------------------------------------------------------------------
+/etc/init.d/nginx start
+---------------------------------------------------------------------------
++
+6. Edit `<PREFIX>/javascript/opensrf_ws.js` and `<PREFIX>/javascript/opensrf_ws_shared.js`
+   and change
++
+[source, javascript]
+---------------------------------------------------------------------------
+var WEBSOCKET_PORT_SSL = 7682;
+---------------------------------------------------------------------------
++
+to
++
+[source, javascript]
+---------------------------------------------------------------------------
+var WEBSOCKET_PORT_SSL = 443;
+---------------------------------------------------------------------------
+
+
 Troubleshooting note for Python users
 -------------------------------------
 

commit ededc269eacb9e69e30074bba2cff35a3148e62e
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Oct 31 15:56:32 2016 -0400

    LP#1638651: example Nginx websockets/http(s) proxy config
    
    Example using Nginx to proxy all websocket, http, and https Apache
    traffic.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/examples/nginx/osrf-ws-http-proxy b/examples/nginx/osrf-ws-http-proxy
new file mode 100644
index 0000000..efa929c
--- /dev/null
+++ b/examples/nginx/osrf-ws-http-proxy
@@ -0,0 +1,56 @@
+# File /etc/nginx/sites-available/osrf-ws-http-proxy
+#
+# $ ln -s /etc/nginx/sites-available/osrf-ws-http-proxy \
+#   /etc/nginx/sites-enabled/osrf-ws-http-proxy
+# $ sudo service nginx restart
+#
+# Assumes Apache is listening on HTTP=7080 and HTTPS=7443
+
+server { 
+    listen 80;
+
+    location / {
+        proxy_pass http://localhost:7080;
+        proxy_set_header Host $host;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header X-Forwarded-Proto $scheme;
+    }
+}
+
+server {
+    listen 443;
+    ssl on;
+
+    # Use the same SSL certificate as Apache.
+    ssl_certificate /etc/apache2/ssl/server.crt;
+    ssl_certificate_key /etc/apache2/ssl/server.key;
+
+    location / {
+        proxy_pass https://localhost:7443;
+        proxy_set_header Host $host;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header X-Forwarded-Proto $scheme;
+    }
+
+    location /osrf-websocket-translator {
+        proxy_pass http://localhost:7680;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+
+        # Needed for websockets proxying.
+        proxy_http_version 1.1;
+        proxy_set_header Upgrade $http_upgrade;
+        proxy_set_header Connection "upgrade";
+
+        # Raise the default nginx proxy timeout values to an arbitrarily
+        # high value so that we can leverage osrf-websocket-translator's 
+        # timeout settings.
+        proxy_connect_timeout 5m;
+        proxy_send_timeout 1h;
+        proxy_read_timeout 1h;
+    }
+}
+
+

-----------------------------------------------------------------------

Summary of changes:
 README                            |   58 +++++++++++++++++++++++++++++++++++++
 examples/nginx/osrf-ws-http-proxy |   56 +++++++++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+), 0 deletions(-)
 create mode 100644 examples/nginx/osrf-ws-http-proxy


hooks/post-receive
-- 
OpenSRF


More information about the opensrf-commits mailing list