diff --git a/docker-compose.yml b/docker-compose.yml index ec5476c..196d5bf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ --- services: frontend: - image: git.brynstuff.co.uk/bryn/web:0.01 + image: git.brynstuff.co.uk/bryn/web:0.02 build: . ports: - 80:80 diff --git a/logs/error.log b/logs/error.log index 1a88f90..f38414f 100644 --- a/logs/error.log +++ b/logs/error.log @@ -216,3 +216,14 @@ Stack trace: 2024/10/12 12:08:01 [notice] 1#1: start worker processes 2024/10/12 12:08:01 [notice] 1#1: start worker process 11 2024/10/12 12:08:01 [notice] 1#1: start worker process 12 +2024/10/13 14:24:08 [notice] 1#1: signal 15 (SIGTERM) received, exiting +2024/10/13 14:24:08 [notice] 11#11: exiting +2024/10/13 14:24:08 [notice] 11#11: exit +2024/10/13 14:24:08 [notice] 12#12: exiting +2024/10/13 14:24:08 [notice] 12#12: exit +2024/10/13 14:24:08 [notice] 1#1: signal 17 (SIGCHLD) received from 12 +2024/10/13 14:24:08 [notice] 1#1: worker process 12 exited with code 0 +2024/10/13 14:24:08 [notice] 1#1: signal 29 (SIGIO) received +2024/10/13 14:24:08 [notice] 1#1: signal 17 (SIGCHLD) received from 11 +2024/10/13 14:24:08 [notice] 1#1: worker process 11 exited with code 0 +2024/10/13 14:24:08 [notice] 1#1: exit diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index b9dd05c..06a9941 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -2,15 +2,37 @@ server { index index.php index.html index.htm; listen 80; listen [::]:80; - location / { - try_files $uri $uri/ =404; - } - location ~ \.php$ { - include fastcgi_params; - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; - } root /app; + charset utf-8; + + #This is a rewrite rule. It is telling nginx to try to find the file in the root directory. If it can't find it, it will try to find it in the root directory with a trailing slash. If it can't find it there, it will try to find it in the routes.php file. + location / { + try_files $uri $uri/ /routes.php?$query_string; + } + + error_page 404 /routes.php; + + location routes.php { + + } + + #This is telling nginx to return a 404 error if it finds a php file. + location ~ \.php { + return 404; + } + + location ~ (\.png|\.jpg|\.gif|\.jpeg|\.zip|\.css|\.svg|\.js)$ { + } + + location = /routes.php { + try_files $uri /routes.php?$query_string; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index routes.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } + server_name bsapi.home.brynstuff.co.uk; }