Skip to content

Commit f39eb3b

Browse files
committed
chore: add staging nginx config
1 parent 35064c5 commit f39eb3b

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

deploy/staging.yuhheardem.com

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
server {
2+
server_name staging.yuhheardem.com;
3+
4+
location / {
5+
root /var/lib/yuhheardem/static;
6+
try_files $uri $uri/ /index.html;
7+
}
8+
9+
location /api/ {
10+
proxy_pass http://127.0.0.1:8013$request_uri;
11+
proxy_set_header Host $host;
12+
proxy_set_header X-Real-IP $remote_addr;
13+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
14+
proxy_set_header X-Forwarded-Proto $scheme;
15+
proxy_http_version 1.1;
16+
proxy_connect_timeout 60s;
17+
proxy_send_timeout 300s;
18+
proxy_read_timeout 300s;
19+
}
20+
21+
location /chat/ {
22+
proxy_pass http://127.0.0.1:8013$request_uri;
23+
proxy_set_header Host $host;
24+
proxy_set_header X-Real-IP $remote_addr;
25+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26+
proxy_set_header X-Forwarded-Proto $scheme;
27+
proxy_http_version 1.1;
28+
proxy_connect_timeout 60s;
29+
proxy_send_timeout 300s;
30+
proxy_read_timeout 300s;
31+
}
32+
33+
location /search/ {
34+
proxy_pass http://127.0.0.1:8013$request_uri;
35+
proxy_set_header Host $host;
36+
proxy_set_header X-Real-IP $remote_addr;
37+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
38+
proxy_set_header X-Forwarded-Proto $scheme;
39+
proxy_http_version 1.1;
40+
proxy_connect_timeout 60s;
41+
proxy_send_timeout 300s;
42+
proxy_read_timeout 300s;
43+
}
44+
45+
location /graph/ {
46+
proxy_pass http://127.0.0.1:8013$request_uri;
47+
proxy_set_header Host $host;
48+
proxy_set_header X-Real-IP $remote_addr;
49+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
50+
proxy_set_header X-Forwarded-Proto $scheme;
51+
proxy_http_version 1.1;
52+
proxy_connect_timeout 60s;
53+
proxy_send_timeout 300s;
54+
proxy_read_timeout 300s;
55+
}
56+
57+
location /health {
58+
proxy_pass http://127.0.0.1:8013$request_uri;
59+
proxy_set_header Host $host;
60+
access_log off;
61+
}
62+
63+
gzip on;
64+
gzip_vary on;
65+
gzip_min_length 1024;
66+
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/javascript;
67+
68+
add_header X-Frame-Options "SAMEORIGIN" always;
69+
add_header X-Content-Type-Options "nosniff" always;
70+
add_header X-XSS-Protection "1; mode=block" always;
71+
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
72+
73+
access_log /var/log/nginx/staging-yuhheardem-access.log;
74+
error_log /var/log/nginx/staging-yuhheardem-error.log;
75+
76+
listen [::]:443 ssl;
77+
listen 443 ssl;
78+
ssl_certificate /etc/letsencrypt/live/staging.yuhheardem.com/fullchain.pem;
79+
ssl_certificate_key /etc/letsencrypt/live/staging.yuhheardem.com/privkey.pem;
80+
include /etc/letsencrypt/options-ssl-nginx.conf;
81+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
82+
}
83+
84+
server {
85+
if ($host = staging.yuhheardem.com) {
86+
return 301 https://$host$request_uri;
87+
}
88+
89+
listen 80;
90+
listen [::]:80;
91+
server_name staging.yuhheardem.com;
92+
return 404;
93+
}

0 commit comments

Comments
 (0)