Created
March 1, 2017 13:59
-
-
Save amessinger/43d872e4744ee2ff07674e02734ace8f to your computer and use it in GitHub Desktop.
Proxy HTTP2 Config for Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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