Skip to content

Instantly share code, notes, and snippets.

@rayriffy rayriffy/Dockerfile Secret
Created Sep 15, 2018

What would you like to do?
FROM nginx:1.15.3-alpine
COPY site-template.conf /etc/nginx/conf.d/site.template
CMD sh -c "envsubst '\$SERVER_NAME \$ROOT \$PHP_BACKEND' < /etc/nginx/conf.d/site.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
server {
listen 80;
listen [::]:80;
index index.html index.php;
server_name ${SERVER_NAME};
root ${ROOT};
error_log /var/log/nginx/${SERVER_NAME}.error.log error;
location / {
try_files $uri $uri/ /index.php?$query_string;
location ~ \.php$ {
fastcgi_pass ${PHP_BACKEND}:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_intercept_errors off;
fastcgi_hide_header X-Powered-By;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
include fastcgi_params;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/index.php/some-path
# Remove the internal directive to allow URIs like this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.