From 8527bdeb8ae6d6364b6ae379fc5542bebd31de4c Mon Sep 17 00:00:00 2001 From: anfu Date: Thu, 12 Sep 2024 22:53:36 +0800 Subject: [PATCH] tijiao --- Dockerfile | 8 +++++++- defaulf.conf | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 defaulf.conf diff --git a/Dockerfile b/Dockerfile index 99bef77..8ee5532 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,10 +9,16 @@ VOLUME /var/www/html ENV NACOS_ADDR="192.168.1.105:8848" \ SERVER_ADDR="192.168.1.161:80" -COPY . /var/www/html +ADD run.sh /run.sh +ADD default.conf /etc/nginx/http.d/default.conf +RUN chmod +x /run.sh + +COPY . /var/www/html WORKDIR /var/www/html +RUN chown www-data:www-data -R /var/www/html + EXPOSE 80 ENTRYPOINT ["/run.sh"] diff --git a/defaulf.conf b/defaulf.conf new file mode 100644 index 0000000..6791247 --- /dev/null +++ b/defaulf.conf @@ -0,0 +1,21 @@ +# This is a default site configuration which will simply return 404, preventing +# chance access to any other virtualhost. + +server { + listen 80; + server_name localhost; + + root /var/www/html/public; + index index.html index.htm index.nginx-debian.html; + + location / { + try_files $uri $uri/ =404; + } + + location ~ \.php$ { + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } +} \ No newline at end of file