Skip to content

Instantly share code, notes, and snippets.

@haiderfaraz
Last active August 15, 2016 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haiderfaraz/e0ee16527c11cb430c4725715fc18952 to your computer and use it in GitHub Desktop.
Save haiderfaraz/e0ee16527c11cb430c4725715fc18952 to your computer and use it in GitHub Desktop.
Docker configuration files for Nginx + PHP-FPM7 set-up
server {
index index.php index.html;
server_name your_server_name;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /code;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
web:
image: nginx:latest
ports:
- "80:80"
volumes:
- ./site.conf:/etc/nginx/conf.d/default.conf
- ./code:/code
links:
- php
php:
image: php:7-fpm
volumes:
- ./code:/code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment