diff --git a/.ebextensions/proxy.config b/.ebextensions/proxy.config index c085831..f663fc3 100644 --- a/.ebextensions/proxy.config +++ b/.ebextensions/proxy.config @@ -12,6 +12,10 @@ files: server { listen 8080; + if ($http_x_forwarded_proto != "https") { + rewrite ^(.*)$ https://darkwire.io$REQUEST_URI permanent; + } + if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})T(\d{2})") { set $year $1; set $month $2; @@ -37,10 +41,6 @@ files: } location / { - if ($http_x_forwarded_proto = "http") { - rewrite ^/(.*)$ https://darkwire.io$request_uri; - } - proxy_pass http://nodejs; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; diff --git a/src/app.js b/src/app.js index d5d7bed..72b71e0 100644 --- a/src/app.js +++ b/src/app.js @@ -29,6 +29,8 @@ app.set('view engine', 'mustache'); app.set('views', __dirname + '/views'); app.use(express.static(__dirname + '/public')); +app.get('/health-check', (req, res) => res.send(200)); + function generateNewRoom(req, res, id) { const room = new Room(io, id); rooms.push(room); diff --git a/src/views/index.mustache b/src/views/index.mustache index da0437d..666adb2 100644 --- a/src/views/index.mustache +++ b/src/views/index.mustache @@ -166,6 +166,7 @@
Your browser does not support the Crypto Web API.
Try using the lastest version of Chrome, Firefox or Safari.
+Otherwise, you may be visiting on http procotol. Try https://darkwire.io.