Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssl nginx将单路径转发到http_Ssl_Nginx_Port_Forward_Nginx Location - Fatal编程技术网

Ssl nginx将单路径转发到http

Ssl nginx将单路径转发到http,ssl,nginx,port,forward,nginx-location,Ssl,Nginx,Port,Forward,Nginx Location,以下情况: 我有一个play framework服务器运行在localhost:9000上。如果现在有人通过http从外部访问该服务器,nginx会将http请求重定向到localhost:9000 现在我分别在该服务器上运行rshiny服务器,它监听端口9271(https),并且必须将流量重定向到9270(http) 我已经试过一些东西了,这是最后一个版本,我没有开始工作: server { listen 9271; server_name _; ssl on

以下情况: 我有一个play framework服务器运行在localhost:9000上。如果现在有人通过http从外部访问该服务器,nginx会将http请求重定向到localhost:9000

现在我分别在该服务器上运行rshiny服务器,它监听端口9271(https),并且必须将流量重定向到9270(http)

我已经试过一些东西了,这是最后一个版本,我没有开始工作:

server {
    listen 9271;
    server_name _;

    ssl    on;
    ssl_session_timeout  5m;
    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers   on;

    ssl_certificate /etc/nginx/ssl/xxx.pem;
    ssl_certificate_key /etc/nginx/ssl/xxx.key;

    access_log /var/log/nginx/access.log xxx_host;
    error_log /var/log/nginx/error.log;

    location / {
        proxy_set_header    Host $host;
        proxy_set_header    X-Real-IP $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header    X-Forwarded-Proto $scheme;

        proxy_pass          http://localhost:9270;
        proxy_read_timeout  90;

        proxy_redirect      http://localhost:9270/ $scheme://$host/;
    }
}

我看你的配置没有问题。它以什么方式不起作用?
/var/log/nginx/access.log
/var/log/nginx/error.log
中的条目是什么?访问日志正常,错误。日志:
2017/05/22 08:07:24[error]22226#22226:*16025 connect()在连接到上游时失败(111:连接被拒绝),客户端::ffff:215.58.157.10,服务器:,请求:“GET/shiny:9271 HTTP/1.1”,上游:“http://127.0.0.1:9000/shiny:9271,主机:“xxx.de”
错误表明问题出在
localhost:9270
而不是
nginx
。服务正在运行,您是否可以看到服务正在侦听端口9270?