The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.
Send messages to iframe using iframeEl.contentWindow.postMessage
Recieve messages using window.addEventListener('message')
| #Nginx Ghost Config | |
| server { | |
| listen 80; | |
| server_name somedomain.com; | |
| rewrite ^(.*) https://$host$1 permanent; | |
| } | |
| # the secure nginx server instance | |
| server { | |
| listen 443 ssl; |
| # | |
| # Acts as a nginx HTTPS proxy server | |
| # enabling CORS only to domains matched by regex | |
| # /https?://.*\.mckinsey\.com(:[0-9]+)?)/ | |
| # | |
| # Based on: | |
| # * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html | |
| # * http://enable-cors.org/server_nginx.html | |
| # | |
| server { |
| #define _CRT_SECURE_NO_DEPRECATE | |
| #include <cpprest/http_listener.h> | |
| #include <iostream> | |
| #include <iomanip> | |
| #include <sstream> | |
| #include <thread> | |
| #include <chrono> | |
| #include <ctime> |
| # | |
| # Slightly tighter CORS config for nginx | |
| # | |
| # A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
| # | |
| # Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
| # Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
| # don't seem to play nicely with this. | |
| # |