This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/answer-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 28a35b4bd fix: add header
28a35b4bd is described below

commit 28a35b4bd477015e95eb5c156937ff022f2dd0d6
Author: shuai <[email protected]>
AuthorDate: Mon Feb 17 16:20:09 2025 +0800

    fix: add header
---
 Dockerfile |  3 +++
 nginx.conf | 12 ++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index 5560e5b24..2479b4fc1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,8 @@
 FROM nginx:alpine
 
+COPY nginx.conf /etc/nginx/conf.d/default.conf
+
 COPY ./build /usr/share/nginx/html
+
 EXPOSE 80
 
diff --git a/nginx.conf b/nginx.conf
new file mode 100644
index 000000000..7efb32c15
--- /dev/null
+++ b/nginx.conf
@@ -0,0 +1,12 @@
+server {
+    listen       80;
+    server_name  localhost;
+
+    location / {
+        root   /usr/share/nginx/html;
+        index  index.html index.htm;
+        try_files $uri $uri/ /index.html;
+
+        add_header Content-Security-Policy "default-src 'self' data: blob: 
'unsafe-inline' https://www.apachecon.com/ https://www.communityovercode.org/ 
https://analytics.apache.org/ https://img.shields.io/ 
https://api-js.mixpanel.com/;";;
+    }
+}

Reply via email to