Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save visuddha/c6e782d8b4fc56ea65ebb3dffb099cb0 to your computer and use it in GitHub Desktop.
Save visuddha/c6e782d8b4fc56ea65ebb3dffb099cb0 to your computer and use it in GitHub Desktop.
# 1. Install nginx
brew install nginx
# 2. Generate self-signed key/crt
openssl req -x509 -nodes -days 365 -newkey rsa:1024 \
-keyout /etc/ssl/private/myssl.key \
-out /etc/ssl/certs/myssl.crt
# 3. Edit nginx config located at: /usr/local/etc/nginx/nginx.conf
server {
listen 443 ssl;
server_name localhost;
ssl_certificate /etc/ssl/certs/myssl.crt;
ssl_certificate_key /etc/ssl/private/myssl.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
# Or whatever port your server is running on
proxy_pass http://127.0.0.1:3000;
}
# 4. Navigate to https://localhost:443 and should forward request to proxy_pass url. Browser might complain that site isn't trusted
Just because using self-signed certs - fine for development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment