Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save renatocron/838d867fce720e1eaabcdb96f5d49211 to your computer and use it in GitHub Desktop.
Save renatocron/838d867fce720e1eaabcdb96f5d49211 to your computer and use it in GitHub Desktop.
server {
# listen 80;
server_name foobar.com www.foobar.com www.foobar.com.br;
location = / {
return 302 http://foobar.com.br?;
}
location / {
return 302 http://foobar.com.br$request_uri;
}
}
server {
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
server_name foobar.com.br;
location / {
# proxy_pass ...
# todo o resto arqui...
}
}
-------
pra gerar o arquivo
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
antes tem q criar o directorio!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment