在同一域上的nginx proxy_pass结果为502/499

时间:2018-11-15 10:31:24

标签: nginx debian webserver nginx-reverse-proxy

我的目标是在https://my-host.de/sub/include-to-show/上包含来自cms的页面,并稍后通过subs_filter对其进行操作。 因此,我做了一个新位置,并向要显示和操作的页面设置了proxy_pass。 通过以下配置,我在https://my-host.de/sub/include-to-show/上获得了状态502,并从https://my-host.de/sub/source-page中获得了状态499-可悲的是,没有更多日志了

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name my-host.de;

    ssl_certificate /etc/nginx/ssl/bundle.pem;
    ssl_certificate_key /etc/nginx/ssl/key.pem;
    include snippets/ssl-parameters.conf;

    root /var/www/my-host/htdocs;
    index index.php;

    access_log /var/www/my-host/logs/access.log;
    error_log /var/www/my-host/logs/error.log;

    client_max_body_size 512M;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ /(.+\.php)$ {
            try_files $uri =404;

            fastcgi_pass unix:/run/php/php7.1-fpm-default.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

            include fastcgi_params;

            fastcgi_buffers 16 16k;
            fastcgi_buffer_size 32k;

            include /etc/nginx/snippets/fastcgi-php.conf;
    }

    location /sub/include-to-show/ {
        proxy_pass https://my-host.de/sub/source-page;
        proxy_redirect default;
    }
}

如果我将domain从proxy_pass更改为另一个,则它可以工作。 我在做什么错了?

已经在proxy_pass位置部分尝试了此设置:

proxy_ignore_client_abort on;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

编辑:顺便说一句-安装程序在2周前开始工作。目前正处于Debian上

0 个答案:

没有答案