Skip to content

Instantly share code, notes, and snippets.

@aristidesneto
Last active December 15, 2017 23:57
Show Gist options
  • Save aristidesneto/c81a3eb8bc4c1e1870376b332654ae47 to your computer and use it in GitHub Desktop.
Save aristidesneto/c81a3eb8bc4c1e1870376b332654ae47 to your computer and use it in GitHub Desktop.
Configuração Nginx SSL
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com.br www.example.com.br;
return 301 https://$server_name$request_uri;
}
server {
# SSL configuration
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
include snippets/ssl-example.com.br.conf;
include snippets/ssl-params.conf;
server_name example.com.br www.example.com.br;
# Log
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Directory root
root /home/abneto/html/example/public;
index index.php index.html;
client_max_body_size 128M;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# pass PHP scripts to FastCGI server
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
location ~ /\.well-known {
allow all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment