Nginx:proxx_pass到上游(xxxx:8080),但总是重定向到80端口?

时间:2016-05-26 03:37:58

标签: nginx

我对StackOverflow几乎更新鲜,我认为我做了一个明确的&现在很清楚标题:)

我的原始服务器可以访问:localhost:8080。现在我创建了一个nginx代理,它将从[IP_ADDr]:8088从外部访问。但结果是它总是将我的网址重定向到[IP_ADDr]:80表示404页面存在。 下面是配置文件:

@Bindable private String startBucksString;
private double localBucks;
public String getStartBucksString() {
    double domainBucks = cd.getStartBucks();
    // Ignore incoming change of less than rounding error
    if( Math.abs(localBucks - domainBucks) < .001  ) return startBucksString;
    startBucksString = "";
    if( domainBucks != 0)
        startBucksString = String.format("$%.2f", domainBucks);
    return startBucksString;
}

public void setStartBucksString(String inBuckstr) {
    double calcBucks=0;
    inBuckstr = inBuckstr.replaceAll( "[^\\d.]", "" );
    try {
         calcBucks = Double.parseDouble(inBuckstr);
    } catch( NumberFormatException e) {
        return;
    }
    // Neglect outgoing change of less than rounding error
    if( Math.abs(localBucks - calcBucks) < .001  ) return;

    startBucksString = String.format("$%.2f", calcBucks);
    localBucks = calcBucks;
    cd.setStartBucks(calcBucks);
    notifyPropertyChanged(BR.startBucksString);
}

下面是proxy-opt.conf:


    proxy_redirect          off;
    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_connect_timeout   30;
    proxy_send_timeout      30;
    proxy_read_timeout      60;
    proxy_buffer_size       4k;
    proxy_buffers           4 32k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;
    proxy_next_upstream error timeout invalid_header http_503 http_404;
    proxy_max_temp_file_size 0;

我发现问题可能与proxy-opt.conf有关。

0 个答案:

没有答案