Created
August 15, 2017 17:34
-
-
Save Pelirrojo/395ff527c555d26cc15000d2cf12d435 to your computer and use it in GitHub Desktop.
NGINX Configuration for [email protected] SITE with SSL, http->https redirection
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
# Based in: | |
# https://www.rosehosting.com/blog/magento-2-with-redis-varnish-and-nginx-as-ssl-termination/ | |
upstream fastcgi_backend { | |
server unix:/run/php/php7.0-fpm.sock; | |
} | |
server { | |
listen 80; | |
server_name www.yoursite.com; | |
location / { | |
return 301 https://$host$request_uri; | |
} | |
} | |
server { | |
listen 443 http2 ssl; | |
server_name www.yoursite.com; | |
set $MAGE_ROOT /var/www/magento; | |
set $MAGE_MODE production; | |
ssl_certificate /etc/ssl/path/to/certificate.cer; | |
ssl_certificate_key /etc/ssl/path/to/certificate.key; | |
access_log /var/log/nginx/yoursite-access.log; | |
error_log /var/log/nginx/yoursite-error.log; | |
include /var/www/magento/nginx.conf.sample; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only replace:
Tested on AWS EC2 Ubuntu 16.04