Skip to content

Instantly share code, notes, and snippets.

@jmlrt
Created September 11, 2017 17:42
Show Gist options
  • Save jmlrt/1bd97440046a9925037bef7027bdcb1f to your computer and use it in GitHub Desktop.
Save jmlrt/1bd97440046a9925037bef7027bdcb1f to your computer and use it in GitHub Desktop.
nginx minimal https reverse proxy configuration
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://webserver:8080;
}
}
server {
listen 443 ssl;
server_name localhost;
ssl_certificate /etc/nginx/conf.d/selfsigned.crt;
ssl_certificate_key /etc/nginx/conf.d/selfsigned.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://webserver:8080;
}
}
@jmlrt
Copy link
Author

jmlrt commented Sep 11, 2017

creating certificate with sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/conf.d/selfsigned.key -out /etc/nginx/conf.d/selfsigned.crt

@joltcan
Copy link

joltcan commented Jun 13, 2023

If you are lazy and don't want to create the certs yourself, just apt install ssl-cert and it creates snakoil certs when installed.

@jmlrt
Copy link
Author

jmlrt commented Jun 13, 2023

If you are lazy and don't want to create the certs yourself, just apt install ssl-cert and it creates snakoil certs when installed.

TIL 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment