Skip to content

Instantly share code, notes, and snippets.

@mrnejc
Created March 17, 2015 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrnejc/85d914cb69bd3cc37d1f to your computer and use it in GitHub Desktop.
Save mrnejc/85d914cb69bd3cc37d1f to your computer and use it in GitHub Desktop.
nginx https 301 redirect
# copy/paste from comment at
# https://www.digitalocean.com/community/questions/http-https-redirect-positive-ssl-on-nginx
server {
listen 80;
server_name devly.co www.devly.co;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl spdy;
server_name devly.co www.devly.co;
ssl on;
ssl_certificate /var/www/devly.co/cert/ssl-bundle.crt;
ssl_certificate_key /var/www/devly.co/cert/devly_co.key;
access_log /var/log/nginx/devly.co.access.log rt_cache;
error_log /var/log/nginx/devly.co.error.log;
root /var/www/devly.co/htdocs;
index index.php index.htm index.html;
include common/wpfc.conf;
include common/wpcommon.conf;
include common/locations.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment