-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
36 lines (32 loc) · 898 Bytes
/
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
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
gzip_vary on;
gzip_min_length 500;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
gzip_buffers 16 8k;
upstream api_upstream {
server twitter-clone-api:3000;
}
server {
listen 80;
rewrite ^/(.*)/$ /$1 permanent;
location /api {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://api_upstream;
}
location / {
root /usr/share/nginx/html;
try_files $uri /index.html;
}
}
}