首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >nginx后面的主机ansible塔

问nginx后面的主机ansible塔
EN

Stack Overflow用户
提问于 2017-07-03 14:13:58
回答 1查看 1K关注 0票数 0

在官方页面上,据说要在nginx后面托管ansible to,你需要在/etc/tower/conf.d/remote_host_headers.py文件中提供头文件。

但是,在我的/etc/tower/文件夹中,没有conf.d/remote_host_headers.py文件。

代码语言:javascript
复制
awx@server:/etc/tower$ tree
.
├── conf.d
│   ├── caching.py
│   ├── celeryd.py
│   ├── ha.py
│   ├── postgres.py
│   └── rabbitmq.py
├── SECRET_KEY
├── settings.py
├── settings.py.20170629122404
├── tower.cert
└── tower.key

如何通过nginx托管ansible塔?

EN

回答 1

Stack Overflow用户

发布于 2017-07-09 04:35:52

我不知道你为什么没有那份文件,但我有:

这是它的内容:

代码语言:javascript
复制
# HTTP headers and meta keys to search to determine remote host name or IP. Add
# additional items to this list, such as "HTTP_X_FORWARDED_FOR", if behind a
# reverse proxy.
# Note: The headers will be searched in order and the first found remote host
# name or IP will be used.
#
# In the below example 8.8.8.7 would be the chosen IP address.
# X-Forwarded-For: 8.8.8.7, 192.168.2.1, 127.0.0.1
# Host: 127.0.0.1
# REMOTE_HOST_HEADERS = ['HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR', 'REMOTE_HOST']

# This setting is now configured via the Tower API.
# REMOTE_HOST_HEADERS = ['REMOTE_ADDR', 'REMOTE_HOST']

REMOTE_HOST_HEADERS = ['HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR', 'REMOTE_HOST']

这最后一行是你想要的,特别是'HTTP_X_FORWARDED_FOR‘-它告诉塔楼在反向代理之外使用了什么IP地址,因为塔楼使用IP地址进行会话关联。

文档是here。

迈克尔

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44878822

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档