Skip to content

Instantly share code, notes, and snippets.

@giordanolima
Created November 10, 2016 02:05
Show Gist options
  • Save giordanolima/088d8a93009d520ab5a7651eba0555ca to your computer and use it in GitHub Desktop.
Save giordanolima/088d8a93009d520ab5a7651eba0555ca to your computer and use it in GitHub Desktop.
Http to Https - Nginx
server {
listen *:80;
listen *:443 ssl;
server_name domain.com;
root /var/www/domain.com/web/public;
ssl on;
ssl_certificate /path/to/cert/fullchain.pem;
ssl_certificate_key /path/to/key.pem;
# Outras diretivas para os cert...
if ($scheme = http) {
return 301 https://$http_host$request_uri;
}
# E todas as outras diretivas que tu tem no teu vhosts
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment