【发布时间】:2017-04-12 10:07:41
【问题描述】:
我在 Wildfly 10.1 应用服务器上部署了一个 webapp。 此 webapp 被监听:http://localhost:8080/app-profile-jsp/ (1)
我成功安装了nginx。服务器已成功安装,我测试提供静态网页和图像。
现在我想配置 nginx 以从 “http://www.frizio.local” (2) 网址。 我在 /etc/hosts 中配置了这个地址。
我在nginx中的配置如下:
server {
listen 80;
server_name frizio.local www.frizio.local;
access_log /var/log/nginx/static.access.log;
error_log /var/log/nginx/static.error.log;
root /srv/http/static;
location / {
proxy_pass http://localhost:8080/app-profile-jsp;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
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_set_header X-Forwarded-Proto https;
}
location /pics {
autoindex on;
autoindex_exact_size off;
}
}
当我尝试访问 (2) 时,服务器响应“404 not found”。
提前致谢
【问题讨论】: