File size: 2,511 Bytes
4aa8f9e
 
4cf2b20
3f835c3
73eb3da
4aa8f9e
 
3f835c3
6f3348f
3f835c3
73eb3da
3f835c3
4aa8f9e
 
 
 
3f835c3
efcbcbb
 
 
 
4aa8f9e
3f835c3
 
4aa8f9e
 
b530b5f
 
 
 
 
 
 
 
 
 
 
 
efcbcbb
 
 
 
 
3f835c3
4aa8f9e
3f835c3
 
 
b530b5f
 
 
 
48a8246
b530b5f
 
4aa8f9e
efcbcbb
4aa8f9e
3f835c3
6f3348f
4aa8f9e
3f835c3
efcbcbb
 
 
 
 
 
 
4aa8f9e
 
3f835c3
 
b530b5f
 
 
 
4aa8f9e
3f835c3
4aa8f9e
3f835c3
 
4aa8f9e
3f835c3
efcbcbb
 
 
 
 
 
 
4aa8f9e
 
3f835c3
6f3348f
b530b5f
 
 
 
3f835c3
 
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
user user;

error_log /tmp/error.log warn;
pid /tmp/nginx.pid;

worker_processes auto;

events {
    worker_connections 1024;
}

http {

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

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;

    keepalive_timeout 65;

    client_max_body_size 800m;

    access_log /tmp/nginx-access.log;

    # ================================
    # HF SAFE TEMP PATHS
    # ================================
    client_body_temp_path /tmp/nginx-body;
    proxy_temp_path       /tmp/nginx-proxy;
    fastcgi_temp_path     /tmp/nginx-fastcgi;
    uwsgi_temp_path       /tmp/nginx-uwsgi;
    scgi_temp_path        /tmp/nginx-scgi;

    # ================================
    # WEBSOCKET SUPPORT
    # ================================
    map $http_upgrade $connection_upgrade {
        default upgrade;
        ''      close;
    }

    server {

        listen 7860;
        server_name _;

        # ================================
        # AUTH ONLY FOR VS CODE AREA
        # ================================
        location /vscode/ {

            auth_basic "Restricted";
            auth_basic_user_file /home/user/app/ngpasswd;

            proxy_pass http://127.0.0.1:5050/;

            proxy_http_version 1.1;

            proxy_set_header Host $host;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;

            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;

            proxy_read_timeout 86400;
            proxy_send_timeout 86400;

            proxy_cache_bypass $http_upgrade;
        }

        # ================================
        # MAIN APP (OPEN WITHOUT AUTH)
        # ================================
        location / {

            proxy_pass http://127.0.0.1:5050/;

            proxy_http_version 1.1;

            proxy_set_header Host $host;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;

            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;

            proxy_read_timeout 86400;
            proxy_send_timeout 86400;

            proxy_cache_bypass $http_upgrade;
        }

        # ================================
        # ERROR HANDLING
        # ================================
        error_page 502 = /;
    }
}