【发布时间】:2016-01-06 16:00:55
【问题描述】:
我有一个运行我的应用程序的内部服务器。此应用程序在端口 9001 上运行。我希望人们通过nginx 访问此应用程序,该应用程序在Ubuntu 机器上运行,该机器在DMZ 网络上运行。
我已经使用sticky 和SSL 模块选项从源代码构建了nginx。它运行良好,但不执行代理传递。
服务器外部IP的DNS名称是:bd.com.tr,我希望人们在输入bd.com.tr时看到页面http://bd.com.tr/public/control.xhtml,但即使是强硬的nginx也会将根请求重定向到我想要的路径,应用程序未显示。
我的 nginx.conf 文件是:
worker_processes 4;
error_log logs/error.log;
worker_rlimit_nofile 20480;
pid logs/nginx.pid;
events {
worker_connections 1900;
}
http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
keepalive_timeout 75;
rewrite_log on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 150;
server {
listen 80;
client_max_body_size 300M;
location = / {
rewrite ^ http://bd.com.tr/public/control.xhtml redirect;
}
location /public {
proxy_pass http://BACKEND_IP:9001;
}
}
}
我可能缺少什么?
【问题讨论】:
标签: http web nginx proxy webserver