基本的Nginx反向代理不工作 - 内部配置

时间:2015-06-17 13:07:24

标签: nginx ubuntu-14.04 reverse-proxy

我正在尝试在单独的Nginx VM(Ubuntu Server 14.04)上为HTPC Manager(Ubuntu Server 14.04 VM)设置反向代理。感谢上帝的虚拟化,因为我已经恢复了大约20次干净的Nginx安装,现在试图解决这个问题。

这是我的配置,对于它需要做的事情来说非常简单,但是https://exampledomain.com的所有WAN请求都坐在白屏上,直到最终404'才会做任何事情。证书似乎解决了,因为我在浏览器地址栏中有一个很好的小锁屏,所以至少配置部分工作。

我不确定的一件事是我应该修改的文件。最好将下面的条目信息添加到/ etc / nginx中的nginx.conf文件中吗?或者,我应该在站点中创建一个新文件 - 在启用站点的情况下在其中创建符号链接吗?

我在pfSense设置中有一个端口转发接受任何WAN 443请求到Nginx VM,端口443,所以我不认为这是问题。

#trying to redirect all http request to https
server {

    listen       80;

    return 301 https://$host$request_uri;

}
#the meat and potatoes
server {

    listen 443;

    server_name exampledomain.com www.exampledomain.com;

    ssl on;

    ssl_certificate /home/user/certs/exampledomain_com.crt;        # path to your cacert.pem

    ssl_certificate_key /home/user/certs/exampledomain_com.key;    # path to your privkey.pem

    ssl_session_cache  builtin:1000  shared:SSL:10m;

    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;

    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;

    ssl_prefer_server_ciphers on;

    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;



    # Fix the “It appears that your reverse proxy set up is broken" error.

       #here is the HTPC Manager VM I want to reverse proxy to
        proxy_pass http://192.168.1.17:8085;

        proxy_read_timeout 90;



    }

}

提前感谢任何提示。

0 个答案:

没有答案