-
-
Save rayriffy/f9a7564f0c7bfd4cdd7cf7b3aa23ba1f to your computer and use it in GitHub Desktop.
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
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;'" |
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
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 | |
internal; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment