无法使用Nginx服务器中的文件夹向上游映射 [英] Unable to map upstream with folder in nginx server

查看:103
本文介绍了无法使用Nginx服务器中的文件夹向上游映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用127.0.0.1:8080/runningSite映射我们的系统端口82,而我正在使用nginx config来获取异常.

I want to map our system port 82 with 127.0.0.1:8080/runningSite and I am gettting exception with nginx config.

 upstream dev {
            server 127.0.0.1:8080/runningSite;
    }
server {
    rewrite_log on;
    listen [::]:81;
    server_name localhost;

    location / {
        proxy_pass  http://dev;
        proxy_set_header  Host $http_host;          
    }

    }

例外:

nginx: [emerg] invalid host in upstream "127.0.0.1:8080/runningSite" in C:\nginx -1.8.1/conf/nginx.conf:85

有人在我错的地方可以帮我吗.

Can anyone please help me where I am wrong.

推荐答案

您可以使用这样的位置

location / {
      proxy_pass http://ttbth/home;
      proxy_set_header  Host $http_host;
    }

这篇关于无法使用Nginx服务器中的文件夹向上游映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆