Skip to content

Instantly share code, notes, and snippets.

@amessinger
Created March 1, 2017 13:59
Show Gist options
  • Save amessinger/43d872e4744ee2ff07674e02734ace8f to your computer and use it in GitHub Desktop.
Save amessinger/43d872e4744ee2ff07674e02734ace8f to your computer and use it in GitHub Desktop.
Proxy HTTP2 Config for Nginx
upstream service {
server 127.0.0.1:4200;
}
server {
listen 443 ssl http2 default_server;
server_name localhost;
# cd /etc/nginx/ssl
# openssl req -x509 -sha256 -newkey rsa:2048 -keyout cert.key -out cert.pem -days 1024 -nodes -subj '/CN=local'
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/cert.key;
location / {
proxy_pass http://service;
}
}
server {
listen 80;
server_name localhost;
return 301 https://$server_name$request_uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment