Created
December 18, 2017 15:57
-
-
Save anonymous/8b55be5e017fd0a37dfb70af5fdc4bd2 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
server { | |
root /var/www/html/example.com; | |
server_name example.com www.example.com; | |
location ~ /\.ht { | |
deny all; | |
} | |
location / { | |
index index.php index.html index.htm fastcgi_index; | |
try_files $uri $uri =404 $uri/ /index.php?$args; | |
} | |
location ~* \.(jpg|jpeg|png|gif|ico|css|js|ttf|woff|pdf)$ { | |
expires 365d; | |
} | |
location ~ \.php$ { | |
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
listen 80; # managed by Certbot | |
listen 443 ssl http2; # managed by Certbot | |
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot | |
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot | |
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | |
if ($scheme != "https") { | |
return 301 https://$host$request_uri; | |
} # managed by Certbot | |
# Redirect non-https traffic to https | |
# if ($scheme != "https") { | |
# return 301 https://$host$request_uri; | |
# } # managed by Certbot | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment