Nginx config example
This commit is contained in:
		
					parent
					
						
							
								c070ff30a8
							
						
					
				
			
			
				commit
				
					
						385bae5542
					
				
			
		
					 1 changed files with 30 additions and 0 deletions
				
			
		
							
								
								
									
										30
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										30
									
								
								README.md
									
										
									
									
									
								
							|  | @ -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. | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Federico Nicolás Motta
				Federico Nicolás Motta