server {
	listen 80 default_server;
    # listen [::]:80 default_server ipv6only=on;

    #_SSL_PORT_#listen 443 ssl default_server;
    #_SSL_PORT_#listen [::]:443 ssl default_server ipv6only=on;
    #_SSL_PORT_#ssl_certificate /etc/nginx/ssl/nginx.crt;
    #_SSL_PORT_#ssl_certificate_key /etc/nginx/ssl/nginx.key;

    #_HTTP_PASSWORD_#auth_basic "Private Property";
    #_HTTP_PASSWORD_#auth_basic_user_file /etc/nginx/.htpasswd;

	root /usr/local/lib/web/frontend/;
	index index.html index.htm;

    location ~ ^/api {
        try_files $uri @api;
    }

    location = /websockify {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_buffering off;
        proxy_connect_timeout   7d;
        proxy_send_timeout      7d;
        proxy_read_timeout      7d;
        proxy_pass http://127.0.0.1:6081;
    }

    location @api {
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:6079;
        max_ranges 0;
    }

    location @proxy {
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:6081;
        max_ranges 0;
    }
}
