{"id":1383,"date":"2020-06-12T16:16:28","date_gmt":"2020-06-12T16:16:28","guid":{"rendered":"http:\/\/blog.davcloud.top:1443\/?p=1383"},"modified":"2020-06-12T16:37:32","modified_gmt":"2020-06-12T16:37:32","slug":"solve-the-problem-that-the-jump-address-appears-inconsistent-with-the-clients-target-address-during-the-reverse-proxy-of-apache","status":"publish","type":"post","link":"https:\/\/blog.davcloud.top\/?p=1383","title":{"rendered":"Solve the problem that the jump address appears inconsistent with the client&#8217;s target address during the reverse proxy of Apache"},"content":{"rendered":"\n<h2>Abstract<\/h2>\n\n\n\n<p>This article aims at solving the problem that the jump address appears inconsistent with the client&#8217;s target address during the reverse proxy of Apache, avoiding inaccessible errors due to inconsistent jump addresses.<\/p>\n\n\n\n<h2><strong>Problem<\/strong><\/h2>\n\n\n\n<p>Example configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost _default_:443>\n    Servername blog.davcloud.top\n    SSLEngine on\n    SSLCertificateFile ssl_certificate_file\n    SSLCertificateKeyFile ssl_certificate_key_file\n    RewriteEngine On\n\n    ProxyPass \/ http:\/\/192.168.1.101:3333\/\n    ProxyPassReverse \/ http:\/\/192.168.1.101:3333\/\n&lt;\/VirtualHost><\/code><\/pre>\n\n\n\n<p>In this example, proxy server URL on the public network is: <a href=\"https:\/\/blog.davcloud.top\">https:\/\/blog.davcloud.top<\/a>\/, and forward internal server URL is: <a href=\"http:\/\/192.168.1.101:3333\">http:\/\/192.168.1.101:3333<\/a>.<\/p>\n\n\n\n<p>When the input access the address on client is: <a href=\"https:\/\/blog.davcloud.top\/test.html\">https:\/\/blog.davcloud.top\/test.html<\/a>, the actual access address is: <a href=\"https:\/\/192.168.1.101:3333\/test.html\">https:\/\/192.168.1.101:3333\/test.html<\/a>, which is not exist to the client.<\/p>\n\n\n\n<h2><strong>Solution<\/strong><\/h2>\n\n\n\n<p>Add a \u201cProxyPreserveHost On\u201d command in the\nconfiguration.<\/p>\n\n\n\n<p>Configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost _default_:443>\n    Servername blog.davcloud.top\n    SSLEngine on\n    SSLCertificateFile ssl_certificate_file\n    SSLCertificateKeyFile ssl_certificate_key_file\n    RewriteEngine On\n\n    ProxyPass \/ http:\/\/192.168.1.101:3333\/\n    ProxyPassReverse \/ http:\/\/192.168.1.101:3333\/\n    ProxyPreserveHost On\n&lt;\/VirtualHost><\/code><\/pre>\n\n\n\n<p> When the input access the address on client is:  <a href=\"https:\/\/blog.davcloud.top\/test.html\">https:\/\/blog.davcloud.top\/test.html<\/a>, the actual access address is: <a href=\"https:\/\/blog.davcloud.top\/test.html\">https:\/\/blog.davcloud.top\/test.html<\/a>, which is correct for the client.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Abstract This article aims at solving the problem that the jump address appears inconsistent with the client&#8217;s target address during the reverse proxy of Apache, avoiding inaccessible errors due to inconsistent jump addresses. Problem Example configuration: In this example, proxy server URL on the public network is: https:\/\/blog.davcloud.top\/, and forward internal server URL is: http:\/\/192.168.1.101:3333. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[604,602,603],"_links":{"self":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts\/1383"}],"collection":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1383"}],"version-history":[{"count":11,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts\/1383\/revisions"}],"predecessor-version":[{"id":1394,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts\/1383\/revisions\/1394"}],"wp:attachment":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}