策略文件TCP服务器的Ngnix配置

时间:2019-01-02 12:26:17

标签: ssl flash tcp nginx-reverse-proxy nginx-config

我的Adobe Flash Player在浏览器(http服务器)中运行,需要直接与在aws EC2中运行的TCP服务器(端口号4500)建立套接字连接。 从here可以知道,闪存需要目标主机的许可。为此,我需要 在端口号843上运行TCP策略服务器。这将服务于策略文件。因此,我在AWS EC2中运行此策略文件服务器(端口号843)和目标TCP服务器(4500)。我可以访问 这两个来自我的本地计算机。但是它没有从Flash Player连接。我从here来到 知道我应该在安全模式下运行策略服务器。我已经有了SSL证书。我的问题是如何在以下ngnix配置文件中进行最少的更改。

upstream my_app {
    server 127.0.0.1:4500;
}
server {
    server_name xyz.com www.xyz.com;
    access_log /var/www/xyz.com/log/access.log;
    error_log /var/www/xyz.com/log/error.log;
    index index.html;
    location / {
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header  Host $http_host;
        proxy_redirect  off;
    }
    location my_app {
        proxy_pass my_app;
    }
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/xyz.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/xyz.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
    if ($host = xyz.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
    listen   80;
    server_name xyz.com www.xyz.com;
    return 404; # managed by Certbot
}

0 个答案:

没有答案