Last active
May 17, 2017 17:13
-
-
Save paulofreitas/2d9d8132754810792847401e8bc9e566 to your computer and use it in GitHub Desktop.
Nginx virtual host sample
This file contains hidden or 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 { | |
listen 80; | |
server_name www.dominio.com.br; | |
return 301 $scheme://dominio.com.br$request_uri; | |
} |
This file contains hidden or 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 { | |
listen 80; | |
server_name dominio.com.br www.dominio.com.br; | |
root /home/root/dominio.com.br/public; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
index index.html index.htm index.php; | |
charset utf-8; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } | |
access_log /home/root/dominio.com.br/storage/logs/access.log combined; | |
error_log /home/root/dominio.com.br/storage/logs/error.log error; | |
error_page 404 /index.php; | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi.conf; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment