diff --git a/Dockerfile b/Dockerfile index a48b756a8ca3b8e9c639898069a43da7ea6abba2..3d933cbd2a5b5ac98ac26da68ef546a48c1fd172 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN ls /home/quick-isuue/web FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:1.24.0-22.03-lts-sp1 as NginxBuilder FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/website/openeuler:22.03-lts-sp1-latest -ENV PATH /usr/share/nginx/sbin:$PATH + ENV NGINX_CONFIG_FILE /etc/nginx/nginx.conf ENV NGINX_CONFIG_PATH /etc/nginx/ ENV NGINX_PID /var/run/nginx.pid @@ -30,6 +30,7 @@ COPY --from=NginxBuilder /usr/share/nginx/sbin/nginx /usr/share/nginx/sbin/nginx COPY --from=NginxBuilder /etc/nginx/modules /etc/nginx/modules COPY --from=NginxBuilder /etc/nginx/geoip /etc/nginx/geoip COPY --from=NginxBuilder /etc/nginx/mime.types /etc/nginx/mime.types + COPY --from=Builder /home/quick-isuue/web/dist /usr/share/nginx/www/ WORKDIR /home/quick-isuue/web @@ -89,7 +90,7 @@ RUN touch /var/run/nginx.pid \ && rm -rf /usr/share/gcc-10.3.1 \ && yum remove gdb-gdbserver findutils passwd shadow -y -COPY ./deploy/monitor.sh ./deploy/entrypoint.sh /etc/nginx +COPY ./deploy/monitor.sh ./deploy/entrypoint.sh /etc/nginx/ RUN chmod 500 /etc/nginx/monitor.sh \ && chmod 500 /etc/nginx/entrypoint.sh \ && chown nginx:nginx /etc/nginx/monitor.sh \ diff --git a/deploy/entrypoint.sh b/deploy/entrypoint.sh index 4602342eca40777fa9eeb9ec2af3af6ecf53b913..9679c15af0bad924ec3aa12d32c40bcf24917ee7 100644 --- a/deploy/entrypoint.sh +++ b/deploy/entrypoint.sh @@ -1,4 +1,4 @@ #!/bin/bash bash /etc/nginx/monitor.sh $DET_URL $DST_PATH & -nginx -g 'daemon off;' \ No newline at end of file +/usr/share/nginx/sbin/nginx -g 'daemon off; \ No newline at end of file diff --git a/deploy/nginx/nginx.conf b/deploy/nginx/nginx.conf index 2f3f6a37aa1122c6cde558b663fc3981e85fead4..852f9bf3ad7ef9203d7d99fa1203a307594db543 100644 --- a/deploy/nginx/nginx.conf +++ b/deploy/nginx/nginx.conf @@ -88,11 +88,6 @@ http { return 444; } - # location ~ /\. { - # deny all; - # return 404; - # } - location = / { rewrite ^/$ /zh/issues/ redirect; } @@ -109,7 +104,7 @@ http { add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; - add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' ; object-src 'none'; frame-src 'none'"; + add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'none'; frame-src 'none'"; add_header Cache-Control "public,max-age=1209600"; } @@ -142,12 +137,8 @@ http { } error_page 401 402 403 405 406 407 413 414 /error.html; - error_page 404 /404.html; error_page 500 501 502 503 504 505 /error.html; - - location = /404.html { - root /usr/share/nginx/www; - } + error_page 404 /index.html; location = /error.html { root /usr/share/nginx/www; diff --git a/public/error.html b/public/error.html new file mode 100644 index 0000000000000000000000000000000000000000..cc5d8e042688ce5c918cc78b13b061401fc939f5 --- /dev/null +++ b/public/error.html @@ -0,0 +1,44 @@ + + + + + + + openEuler Quick-Issue + + + + +
+ +

Error

+
+ +