Appengine - local server server with https

Purpose: Shorten the feedback loop using the App Engine developer server. For my use, this should be available as a public HTTPS address. App Engine Developer Server only supports HTTP.

How to do it: Use ngrok to open the local dev environment as the https public address.

Reverse proxy from nginx from https to http.

It seems possible, but for the life of me I have no configuration.

I work with the standard Java App Engine on osx.

Other working solutions or ideas are welcome. Of course, there is a way to do this.

+6
source share
3 answers

NGINX - https://debtstracker.io/

NGINX. hosts yourproject.local.

    server {  # This servers dynamic content of DebtsTracker.io project over HTTPS
            listen          443;
            server_name     debtstracker.local;
            ssl                  on;
            ssl_certificate      /etc/ssl/certs/debtstracker-local.crt;
            ssl_certificate_key  /etc/ssl/private/debtstracker-local.key;

            location /app/ {
                    proxy_pass   http://localhost:8100/;
                    proxy_set_header Host $http_host;
            }

            location / {
                    proxy_pass   http://127.0.0.1:8080;
                    proxy_set_header Host $http_host;
            }
    }

GAE devserver 2nd Ionic.

bash, :

#!/usr/bin/env bash
# https://www.accuweaver.com/2014/09/19/make-chrome-accept-a-self-signed-certificate-on-osx/

# https://gist.github.com/jessedearing/2351836

# Run using "sudo"

echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out debtstracker-local.key 1024

echo "Generating a Certificate Signing Request..."
openssl req -new -key debtstracker-local.key -out debtstracker-local.csr

echo "Removing pass-phrase from key (for nginx)..."
cp debtstracker-local.key debtstracker-local.key.org
openssl rsa -in debtstracker-local.key.org -out debtstracker-local.key
rm debtstracker-local.key.org

echo "Generating certificate..."
openssl x509 -req -days 365 -in debtstracker-local.csr -signkey debtstracker-local.key -out debtstracker-local.crt

echo "Copying certificate (debtstracker-local.crt) to /etc/ssl/certs/"
mkdir -p  /etc/ssl/certs
cp debtstracker-local.crt /etc/ssl/certs/

echo "Copying key (debtstracker-local.key) to /etc/ssl/private/"
mkdir -p  /etc/ssl/private
cp debtstracker-local.key /etc/ssl/private/

, . , .

+1
+2

ngrok https urls http-, ngrok - https- GAE

, CNAME

ngrok http -hostname=dev.example.com 8080
0

Source: https://habr.com/ru/post/1015848/


All Articles