Here is a sample of a /etc/nginx/sites-enabled/<my-site>.conf to pass all requests on php files tp php-fpm on port 9000
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
upstream php70 { | |
server php70:9000; | |
} | |
server { | |
listen 80 default_server; | |
server_name _ localhost php70.dev www.php70.dev; | |
index index.php index.html; | |
root /var/www; | |
charset utf-8; | |
access_log /var/log/nginx/default-php70-access.log; | |
error_log /var/log/nginx/default-php70-error.log error; | |
location / { | |
autoindex on; | |
try_files $uri =404; | |
} | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
if (!-f $document_root$fastcgi_script_name) { | |
return 404; | |
} | |
include fastcgi_params; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param DOCUMENT_ROOT $document_root; | |
fastcgi_pass php70; | |
} | |
} | |
Keine Kommentare:
Kommentar veröffentlichen