From 6175cf9d70fe9e98b6ec0fa90833a20e1dae7827 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 8 Jan 2020 12:59:11 +0100 Subject: better conf --- Dockerfile | 17 ++++++++++++----- srcs/conf/test.com | 28 +++++++++++++++++++--------- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 09e8e80..28f93bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,13 @@ FROM debian:buster RUN apt update && \ - apt install -y nginx mariadb-server php-fpm php-mysql + apt install -y nginx \ + mariadb-server \ + php-fpm \ + php-mysql \ + phpmyadmin \ + php-mbstring \ + php-gettext COPY srcs/wordpress /var/www/html COPY srcs/conf /etc/nginx/sites-available/ @@ -10,7 +16,8 @@ RUN ln -fs /etc/nginx/sites-available/test.com /etc/nginx/sites-enabled/default EXPOSE 80 -CMD service nginx start && \ - service mysql start && \ - service php7.3-fpm start && \ - sleep infinity & wait +RUN service nginx start && \ + service mysql start && \ + service php7.3-fpm start + +CMD sleep infinity & wait diff --git a/srcs/conf/test.com b/srcs/conf/test.com index 2331b3b..866f8ad 100644 --- a/srcs/conf/test.com +++ b/srcs/conf/test.com @@ -1,20 +1,30 @@ server { - listen 80; - root /var/www/html; - index index.php index.html index.htm index.nginx-debian.html; - server_name test.com; + listen 80; # listen all ip on port 80 (0.0.0.0:80) + root /var/www/html; # where to find files for location blocks + server_name test.com; # domain name + index index.php index.html index.htm; # files for empty uri + # all uri location / { - try_files $uri $uri/ =404; + try_files $uri $uri/ =404; # if uri or uri/ no valid, 404 error } + # php files location ~ \.php$ { - include snippets/fastcgi-php.conf; - fastcgi_pass - unix:/var/run/php/php7.3-fpm.sock; + try_files $uri =404; # try file in uri, if not found fallthrough 404 error + + # php fpm proxy + fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; # socket where php fpm is running + fastcgi_index index.php # php fpm default index + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # idk yet + include snippets/fastcgi-php.conf; # include php fpm settings } - location ~ /\.ht { + # configuration files + # deny access and no logs + location ~ /\. { deny all; + access_log off; + log_not_found off; } } -- cgit