forked from fabnumdef/chatbot-front
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
47 lines (45 loc) · 1.74 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
44
45
46
47
server {
listen 80 default_server;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
location / {
proxy_pass_header Content-Security-Policy;
}
location /backoffice {
add_header X-Frame-Options SAMEORIGIN;
add_header Cache-Control "no-store, no-cache, must-revalidate";
alias /var/www/chatbot-front;
try_files $uri $uri/ /index.html =404;
proxy_pass_header Content-Security-Policy;
}
location /chatbot {
alias /var/www/webchat;
add_header Cache-Control "no-store, no-cache, must-revalidate";
try_files $uri $uri/ /index.html =404;
proxy_pass_header Content-Security-Policy;
}
location /api/ {
add_header Content-Security-Policy "default-src 'self'; img-src * data:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; connect-src 'self' ws: wss:" always;
proxy_pass http://127.0.0.1:3000/api/;
proxy_pass_header Content-Security-Policy;
}
location /socket-chatbot/ {
proxy_pass http://127.0.0.1:5005/socket.io/;
proxy_pass_header Content-Security-Policy;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
location /media/ {
add_header Cache-Control "public";
alias /var/www/chatbot-back/mediatheque/;
proxy_pass_header Content-Security-Policy;
}
location /historic/ {
add_header Cache-Control "public";
alias /var/www/chatbot-back/historic/;
proxy_pass_header Content-Security-Policy;
}
}