File size: 1,596 Bytes
1f8085b
 
 
ae4ef28
 
1f8085b
 
 
 
0921002
1f8085b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
973c33a
ae4ef28
 
1f8085b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
48
49
50
51
52
53
54
55
56
57
58
user app_user;
worker_processes auto;
error_log stderr notice;
pid /tmp/nginx.nid;
#error_log  /tmp/error.log;
# run nginx in foreground
#daemon off;

events {
    worker_connections 10;
}

http {
    client_body_temp_path /tmp/client_body;
    fastcgi_temp_path /tmp/fastcgi_temp;
    proxy_temp_path /tmp/proxy_temp;
    scgi_temp_path /tmp/scgi_temp;
    uwsgi_temp_path /tmp/uwsgi_temp;
    #error_log  /tmp/error.log;
    access_log /dev/stdout;

    server_tokens on;
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';
    log_format compact '$remote_addr - $time_local - "$request" - $status';
    gzip on;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    
    #access_log  off;

    # disable to avoid caching and volume mount issues
    sendfile       on; 
    tcp_nopush     on;
    tcp_nodelay    on;

    keepalive_timeout  30;

    server {
        listen 7860;
        server_name 0.0.0.0;

        location / {
            root /var/www/portfolio;
            index index.html;
            try_files $uri /index.html;
        }

        location /api/ {
            proxy_pass http://127.0.0.1:8000/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }
}