nginx proxy_pass on same domain results in 502 / 499










0















My goal is, to include on https://my-host.de/sub/include-to-show/ a page from a cms and manipulate it later via the subs_filter.
So i did a new location and made a proxy_pass to the page that i want to show and manipulate.
With the following config i get a status 502 on https://my-host.de/sub/include-to-show/ and a status 499 from https://my-host.de/sub/source-page - sadly no further logs



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;




If i change the Domain from the proxy_pass to another one it works.
What am i doing wrong?



Already tried this settings in the proxy_pass location part:



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;


Edit: By the way - the Setup worked 2 weeks ago. Currently on debian stretch










share|improve this question
























  • Is https://my-host.de/sub/source-page hosted on the same server? And if directly accessing that URL fails, why would a reverse proxy do any better?

    – Richard Smith
    Nov 15 '18 at 11:45











  • it is on the same server and in the same config (see snippet). Accessing the URL directly does work, also with curl on the same machine.

    – develth
    Nov 15 '18 at 14:45











  • Why reverse: I have to filter & replace some elements with sub_filters

    – develth
    Nov 15 '18 at 14:45











  • Maybe i was wrote a little bit confused. The 499 just got thrown via reverse_proxy, if i access it directly it works with a 200

    – develth
    Nov 15 '18 at 14:48











  • I understand, so the access log shows a 502 for the original request and a 499 for the proxy passed request. Is there anything in the error log?

    – Richard Smith
    Nov 15 '18 at 14:54















0















My goal is, to include on https://my-host.de/sub/include-to-show/ a page from a cms and manipulate it later via the subs_filter.
So i did a new location and made a proxy_pass to the page that i want to show and manipulate.
With the following config i get a status 502 on https://my-host.de/sub/include-to-show/ and a status 499 from https://my-host.de/sub/source-page - sadly no further logs



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;




If i change the Domain from the proxy_pass to another one it works.
What am i doing wrong?



Already tried this settings in the proxy_pass location part:



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;


Edit: By the way - the Setup worked 2 weeks ago. Currently on debian stretch










share|improve this question
























  • Is https://my-host.de/sub/source-page hosted on the same server? And if directly accessing that URL fails, why would a reverse proxy do any better?

    – Richard Smith
    Nov 15 '18 at 11:45











  • it is on the same server and in the same config (see snippet). Accessing the URL directly does work, also with curl on the same machine.

    – develth
    Nov 15 '18 at 14:45











  • Why reverse: I have to filter & replace some elements with sub_filters

    – develth
    Nov 15 '18 at 14:45











  • Maybe i was wrote a little bit confused. The 499 just got thrown via reverse_proxy, if i access it directly it works with a 200

    – develth
    Nov 15 '18 at 14:48











  • I understand, so the access log shows a 502 for the original request and a 499 for the proxy passed request. Is there anything in the error log?

    – Richard Smith
    Nov 15 '18 at 14:54













0












0








0








My goal is, to include on https://my-host.de/sub/include-to-show/ a page from a cms and manipulate it later via the subs_filter.
So i did a new location and made a proxy_pass to the page that i want to show and manipulate.
With the following config i get a status 502 on https://my-host.de/sub/include-to-show/ and a status 499 from https://my-host.de/sub/source-page - sadly no further logs



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;




If i change the Domain from the proxy_pass to another one it works.
What am i doing wrong?



Already tried this settings in the proxy_pass location part:



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;


Edit: By the way - the Setup worked 2 weeks ago. Currently on debian stretch










share|improve this question
















My goal is, to include on https://my-host.de/sub/include-to-show/ a page from a cms and manipulate it later via the subs_filter.
So i did a new location and made a proxy_pass to the page that i want to show and manipulate.
With the following config i get a status 502 on https://my-host.de/sub/include-to-show/ and a status 499 from https://my-host.de/sub/source-page - sadly no further logs



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;




If i change the Domain from the proxy_pass to another one it works.
What am i doing wrong?



Already tried this settings in the proxy_pass location part:



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;


Edit: By the way - the Setup worked 2 weeks ago. Currently on debian stretch







nginx debian webserver nginx-reverse-proxy






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 10:47







develth

















asked Nov 15 '18 at 10:31









develthdevelth

396519




396519












  • Is https://my-host.de/sub/source-page hosted on the same server? And if directly accessing that URL fails, why would a reverse proxy do any better?

    – Richard Smith
    Nov 15 '18 at 11:45











  • it is on the same server and in the same config (see snippet). Accessing the URL directly does work, also with curl on the same machine.

    – develth
    Nov 15 '18 at 14:45











  • Why reverse: I have to filter & replace some elements with sub_filters

    – develth
    Nov 15 '18 at 14:45











  • Maybe i was wrote a little bit confused. The 499 just got thrown via reverse_proxy, if i access it directly it works with a 200

    – develth
    Nov 15 '18 at 14:48











  • I understand, so the access log shows a 502 for the original request and a 499 for the proxy passed request. Is there anything in the error log?

    – Richard Smith
    Nov 15 '18 at 14:54

















  • Is https://my-host.de/sub/source-page hosted on the same server? And if directly accessing that URL fails, why would a reverse proxy do any better?

    – Richard Smith
    Nov 15 '18 at 11:45











  • it is on the same server and in the same config (see snippet). Accessing the URL directly does work, also with curl on the same machine.

    – develth
    Nov 15 '18 at 14:45











  • Why reverse: I have to filter & replace some elements with sub_filters

    – develth
    Nov 15 '18 at 14:45











  • Maybe i was wrote a little bit confused. The 499 just got thrown via reverse_proxy, if i access it directly it works with a 200

    – develth
    Nov 15 '18 at 14:48











  • I understand, so the access log shows a 502 for the original request and a 499 for the proxy passed request. Is there anything in the error log?

    – Richard Smith
    Nov 15 '18 at 14:54
















Is https://my-host.de/sub/source-page hosted on the same server? And if directly accessing that URL fails, why would a reverse proxy do any better?

– Richard Smith
Nov 15 '18 at 11:45





Is https://my-host.de/sub/source-page hosted on the same server? And if directly accessing that URL fails, why would a reverse proxy do any better?

– Richard Smith
Nov 15 '18 at 11:45













it is on the same server and in the same config (see snippet). Accessing the URL directly does work, also with curl on the same machine.

– develth
Nov 15 '18 at 14:45





it is on the same server and in the same config (see snippet). Accessing the URL directly does work, also with curl on the same machine.

– develth
Nov 15 '18 at 14:45













Why reverse: I have to filter & replace some elements with sub_filters

– develth
Nov 15 '18 at 14:45





Why reverse: I have to filter & replace some elements with sub_filters

– develth
Nov 15 '18 at 14:45













Maybe i was wrote a little bit confused. The 499 just got thrown via reverse_proxy, if i access it directly it works with a 200

– develth
Nov 15 '18 at 14:48





Maybe i was wrote a little bit confused. The 499 just got thrown via reverse_proxy, if i access it directly it works with a 200

– develth
Nov 15 '18 at 14:48













I understand, so the access log shows a 502 for the original request and a 499 for the proxy passed request. Is there anything in the error log?

– Richard Smith
Nov 15 '18 at 14:54





I understand, so the access log shows a 502 for the original request and a 499 for the proxy passed request. Is there anything in the error log?

– Richard Smith
Nov 15 '18 at 14:54












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317400%2fnginx-proxy-pass-on-same-domain-results-in-502-499%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317400%2fnginx-proxy-pass-on-same-domain-results-in-502-499%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

What does pagestruct do in Eviews?

Dutch intervention in Lombok and Karangasem

Channel Islands