-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
43 lines (38 loc) · 1.69 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
worker_processes auto;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name localhost;
# フロントエンドの設定
location / {
# connect-src: フロントエンドでバックエンドのAPIサーバーを利用するために許可する
# style-src: Vue.jsを利用する場合はselfだけでは効かないので、unsafe-inlineも許可する(ここはより適切な設定ができるかも)
add_header Content-Security-Policy "
default-src 'self';
connect-src 'self' http://localhost:8080;
style-src 'self' 'unsafe-inline';
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
";
add_header Cross-Origin-Opener-Policy "same-origin";
add_header Cross-Origin-Resource-Policy "same-origin";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff";
add_header X-Frame-Options "DENY";
add_header X-Permitted-Cross-Domain-Policies "none";
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()";
add_header Cross-Origin-Embedder-Policy "require-corp";
proxy_hide_header X-Powered-By;
proxy_pass http://localhost:5173;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}