Nginx config example

This commit is contained in:
Federico Nicolás Motta 2016-11-13 22:24:25 -03:00 committed by GitHub
commit 385bae5542

View file

@ -827,6 +827,36 @@ sudo -u postgres psql phpcrudapi -c "CREATE EXTENSION postgis;"
In the above string "phpcrudapi" is the name of your database.
## Nginx config example
```
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name server_domain_or_IP;
location / {
try_files $uri $uri/ =404;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
try_files $fastcgi_script_name =404;
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
```
## Pretty URL
You may "rewrite" the URL to remove the "api.php" from the URL.