Created
November 23, 2020 02:39
-
-
Save danfoust/f6754e49502b4c8c1b8ac9debaeeb20f to your computer and use it in GitHub Desktop.
Basic Nginx + PHP-FPM Docker config
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; | |
index index.php index.html; | |
server_name localhost; | |
root /var/www/html; | |
error_log /var/log/nginx/error; | |
access_log /var/log/nginx/access; | |
location / { | |
# Try to serve file directly, fallback to index.php | |
try_files $uri /index.php$is_args$args; | |
} | |
location ~ ^/index\.php(/|$) { | |
fastcgi_pass wordpress_service:9000; | |
fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | |
fastcgi_param DOCUMENT_ROOT $realpath_root; | |
fastcgi_buffer_size 128k; | |
fastcgi_buffers 4 256k; | |
fastcgi_busy_buffers_size 256k; | |
internal; | |
} | |
location ~ \.php$ { | |
return 404; | |
} | |
} |
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.19.4-alpine | |
COPY default.conf /etc/nginx/conf.d/ | |
WORKDIR /var/www/html |
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 wordpress:php7.4-fpm-alpine | |
WORKDIR /var/www/html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment