Skip to content

Instantly share code, notes, and snippets.

@hasangilak
Created March 2, 2017 00:42
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 hasangilak/d69b712613abd1583abfaf775ed26d10 to your computer and use it in GitHub Desktop.
Save hasangilak/d69b712613abd1583abfaf775ed26d10 to your computer and use it in GitHub Desktop.
server {
listen 443 ssl;
listen 80;
server_name filan.com www.filan.com;
root /var/www/samsung/public;
index index.php index.html index.htm;
if ($http_cf_visitor ~ '{"scheme":"http"}') {
return 301 https://$server_name$request_uri;
}
ssl_certificate /etc/letsencrypt/live/filan.com/fullchain1.pem;
ssl_certificate_key /etc/letsencrypt/live/filan.com/privkey1.pem;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass php-upstream;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* (?:^|/)\. {
deny all;
}
location ^~ /.well-known {
allow all;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment