* Show http link if crypto not supported

* Fix for https on EB
This commit is contained in:
Alan Friedman 2017-12-02 11:07:41 -05:00 committed by GitHub
parent 4358703eeb
commit f0242b6ff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -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;

View File

@ -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);

View File

@ -166,6 +166,7 @@
<div class="modal-body">
<p>Your browser does not support the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Crypto" target="_blank">Crypto Web API</a>.</p>
<p>Try using the lastest version of Chrome, Firefox or Safari.</p>
<p>Otherwise, you may be visiting on http procotol. Try <a href="https://darkwire.io">https://darkwire.io</a>.</p>
</div>
</div>
</div>