Created
April 4, 2016 22:51
-
-
Save luissquall/ce200ae872f18a89e6b684409d10cf6a to your computer and use it in GitHub Desktop.
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
## Redirects all HTTP traffic to the HTTPS host | |
## | |
## http://serverfault.com/questions/67316/in-nginx-how-can-i-rewrite-all-http-requests-to-https-while-maintaining-sub-dom/337893#337893 | |
## https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab-ssl | |
## http://serverfault.com/questions/638367/do-you-need-separate-ipv4-and-ipv6-listen-directives-in-nginx/638370#638370 | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name {{ domain }}; | |
return 301 https://$server_name$request_uri; | |
access_log /var/log/nginx/{{ domain }}.access.log; | |
error_log /var/log/nginx/{{ domain }}.error.log; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment