Created
May 18, 2018 21:16
-
-
Save wesleyserafim/3879fbdfbdeeb132d0f5756ef510bb7f to your computer and use it in GitHub Desktop.
Configuração do PHP no Nginx
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 { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /var/www/html; | |
client_max_body_size 20M; | |
# Add index.php to the list if you are using PHP | |
index index.php index.html index.htm index.nginx-debian.html; | |
server_name _; | |
if (!-d $request_filename) { | |
rewrite ^/(.+)/$ /$1 permanent; | |
} | |
location / { | |
# First attempt to serve request as file, then | |
# as directory, then fall back to displaying a 404. | |
# try_files $uri $uri/ =404; | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 | |
# | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
fastcgi_read_timeout 600; | |
include snippets/fastcgi-php.conf; | |
# With php7.0-fpm: | |
fastcgi_pass unix:/run/php/php7.1-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment