小编Cpp*_*ner的帖子

Nginx https 重写将 POST 变为 GET

我的代理服务器在 ip A 上运行,这就是人们访问我的 Web 服务的方式。nginx 配置将重定向到 ip B 上的虚拟机。

对于 IP A 上的代理服务器,我的站点中有此可用

server {
        listen 443;
        ssl on;
        ssl_certificate nginx.pem;
        ssl_certificate_key nginx.key;

        client_max_body_size 200M;
        server_name localhost 127.0.0.1;
        server_name_in_redirect off;

        location / {
                proxy_pass http://10.10.0.59:80;
                proxy_redirect http://10.10.0.59:80/ /;

                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

}

server {
        listen 80;
        rewrite     ^(.*)   https://$http_host$1 permanent;
        server_name localhost 127.0.0.1;
        server_name_in_redirect off;
        location / {
                proxy_pass http://10.10.0.59:80;
                proxy_redirect http://10.10.0.59:80/ /;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; …
Run Code Online (Sandbox Code Playgroud)

rewrite nginx

20
推荐指数
2
解决办法
3万
查看次数

您如何为 OpenLDAP 设置密码哈希?

我在 Ubuntu 12.04 上有以下版本:

OpenLDAP: slapd  (Sep 19 2013 22:49:31) $
buildd@batsu:/build/buildd/openldap-2.4.28/debian/build/servers/slapd
Run Code Online (Sandbox Code Playgroud)

OpenLDAP 现在提供 SSHA 作为默认哈希。我想使用不同的哈希。然而,旧的教程基于编辑/etc/ldap/slapd.conf,在较新版本的 OpenLDAP 中已经消失。我应该更改哪个文件?

openldap ldap

7
推荐指数
1
解决办法
2万
查看次数

nginx - 使用 $http_host 危险吗?

从我自己的答案来看,我必须替换$host$http_host才能解决我的问题......

但这安全吗?

似乎$http_host所做的一切都是从标头中暴露整个内容HOST这里的解释对我来说仍然不清楚......

有谁知道为什么会$http_host更危险?


编辑

实际上,这是我的第三次编辑......读完后我应该重新考虑我的立场: https ://stackoverflow.com/questions/1459739/php-serverhttp-host-vs-serverserver-name-am-i-understanding -the-ma

我不确定 nginx 对此有何反应,但是你们认为 nginx 是否也符合 Chris 的测试结果,即两者都不安全?

什么情况下,使用$http_host时你能想到利用的办法吗?此外,为什么删除端口号很重要?

我知道有可能破坏网络,并发送一些信息Host: fake or old ip,然后在我在其他地方读到时执行重新绑定攻击?

nginx

4
推荐指数
1
解决办法
6914
查看次数

Nginx - 当隧道 url 在没有端口号的情况下重定向时

我的问题与此非常相似:nginx proxy pass redirects ignore port

我正在使用 nginx 1.0.14。

我希望能够通过 ssh 隧道进入我的 Django 网站,以便我可以远程工作。我在我的个人电脑上测试了一个简单的 Django 项目,使用非常简单的 nginx 配置(启动器,默认)。我隧道和重定向返回端口号作为 url 的一部分。所以我确定这不是 Django 问题。主要是我的nginx配置。

这是相关的部分。

server {
    listen 80;
    server_name localhost 127.0.0.1;
    server_name_in_redirect off;

# location other services go here

location ~ /forum/(.*)$ {
    #rewrite ^(.*):(.*)/forum(.*)$ /$2 last;
    #rewrite ^(.*)$ http://localhost:8000/$1;
    #rewrite ^/forum(.*)$ $1 break;

    # the forum service runs as local, listens to 8000 port...
    proxy_pass http://localhost:8000;
    proxy_redirect default;

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Run Code Online (Sandbox Code Playgroud)

那么如果我 …

nginx reverse-proxy ssh-tunnel django

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

nginx ×3

django ×1

ldap ×1

openldap ×1

reverse-proxy ×1

rewrite ×1

ssh-tunnel ×1