Skip to content

Commit

Permalink
add nginx config for staging (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
juancwu authored Dec 9, 2024
2 parents fe6747c + 441cb7a commit c78ef20
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions nginx.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
limit_req_zone $binary_remote_addr zone=two:10m rate=10r/s;

server {
listen 443 ssl;
server_name nk-preview.konfer.ca;

ssl_certificate /etc/ssl/nk-preview/cert.pem;
ssl_certificate_key /etc/ssl/nk-preview/key.pem;

root /home/spur/staging/frontend;
index index.html

gzip on;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css text/xml text/javascript application/javascript
application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\.";


# frontend
location / {
try_files $uri $uri/ /index.html;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
}


# backend
location /api/v1 {
limit_req zone=two burst=20 nodelay;
limit_req_status 444;
proxy_pass http://127.0.0.1:6969;
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;
proxy_set_header X-App-Name nk-staging;
}

# deny access to hidden files
location ~ /\. {
deny all;
}
}

0 comments on commit c78ef20

Please sign in to comment.