nginx proxy_pass on same domain results in 502 / 499
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
|
show 2 more comments
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
Ishttps://my-host.de/sub/source-pagehosted 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
|
show 2 more comments
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
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
nginx debian webserver nginx-reverse-proxy
edited Nov 15 '18 at 10:47
develth
asked Nov 15 '18 at 10:31
develthdevelth
396519
396519
Ishttps://my-host.de/sub/source-pagehosted 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
|
show 2 more comments
Ishttps://my-host.de/sub/source-pagehosted 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
|
show 2 more comments
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Is
https://my-host.de/sub/source-pagehosted 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