How do i redirect this reverse proxy to not have trailing slash The 2019 Stack Overflow...

What tool would a Roman-age civilization have to grind silver and other metals into dust?

Why don't Unix/Linux systems traverse through directories until they find the required version of a linked library?

Is there a name of the flying bionic bird?

JSON.serialize: is it possible to suppress null values of a map?

Why isn't airport relocation done gradually?

How to manage monthly salary

What does "rabbited" mean/imply in this sentence?

Can't find the latex code for the ⍎ (down tack jot) symbol

What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?

Does light intensity oscillate really fast since it is a wave?

Where does the "burst of radiance" from Holy Weapon originate?

The difference between dialogue marks

Is three citations per paragraph excessive for undergraduate research paper?

Does duplicating a spell with Wish count as casting that spell?

Is this food a bread or a loaf?

Can distinct morphisms between curves induce the same morphism on singular cohomology?

How to deal with fear of taking dependencies

If the Wish spell is used to duplicate the effect of Simulacrum, are existing duplicates destroyed?

What is the steepest angle that a canal can be traversable without locks?

Should I use my personal or workplace e-mail when registering to external websites for work purpose?

Geography at the pixel level

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

It's possible to achieve negative score?

"To split hairs" vs "To be pedantic"



How do i redirect this reverse proxy to not have trailing slash



The 2019 Stack Overflow Developer Survey Results Are InHow to Protect Apache server from this attackNginx reverse proxy to apache gives timeout if you dont put in a trailing slashnginx proxypath https redirect fails without trailing slashnginx add trailing slashrewrite rule does not rewrite url as expectedForward Slash within a reverse proxy for WordpressNginx reverse proxy https -> httpReverse proxy using Nginx to wordpress app hosted using nginxIIS Reverse Proxy Fails without Trailing SlashWhere can I create or edit Nginx URL rewrite configuration file in Google App Engine?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have a website that connects to my blog using a reverse proxy to make the url look like this https://example.com/blog



The blog is hosted on WordPress through wpengine. The website is on an Nginx server.



What i am trying to do is redirect the trailing slash which i have done on WordPress website but then now the reverse proxy doesnt pick up all the posts and redirects to the wpengine site.



My WordPress permalink looks like this /%postname%



This is my nginx configuration for the blog:



location /blog {
proxy_pass https://myblog.wpengine.com:443/;
proxy_set_header Host myblog.wpengine.com;

rewrite /blog/(.*) /$1 break;

subs_filter_types text/html text/css text/xml;
subs_filter 'myblog.wpengine.com' 'example.com/blog' gi;
}


This is the .htaccess file on my wordpress site:



# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

RewriteRule (.+)/$ $1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


When I go to https://example.com/blog/ it loads the blog but when i go to https://example.com/blog/my-first-post it redirects to https://myblog.wpengine.com/blog/my-first-post



How can I keep it all on the one URL without trailing slashes









share







New contributor




user5834867 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    I have a website that connects to my blog using a reverse proxy to make the url look like this https://example.com/blog



    The blog is hosted on WordPress through wpengine. The website is on an Nginx server.



    What i am trying to do is redirect the trailing slash which i have done on WordPress website but then now the reverse proxy doesnt pick up all the posts and redirects to the wpengine site.



    My WordPress permalink looks like this /%postname%



    This is my nginx configuration for the blog:



    location /blog {
    proxy_pass https://myblog.wpengine.com:443/;
    proxy_set_header Host myblog.wpengine.com;

    rewrite /blog/(.*) /$1 break;

    subs_filter_types text/html text/css text/xml;
    subs_filter 'myblog.wpengine.com' 'example.com/blog' gi;
    }


    This is the .htaccess file on my wordpress site:



    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]

    RewriteRule (.+)/$ $1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>


    When I go to https://example.com/blog/ it loads the blog but when i go to https://example.com/blog/my-first-post it redirects to https://myblog.wpengine.com/blog/my-first-post



    How can I keep it all on the one URL without trailing slashes









    share







    New contributor




    user5834867 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have a website that connects to my blog using a reverse proxy to make the url look like this https://example.com/blog



      The blog is hosted on WordPress through wpengine. The website is on an Nginx server.



      What i am trying to do is redirect the trailing slash which i have done on WordPress website but then now the reverse proxy doesnt pick up all the posts and redirects to the wpengine site.



      My WordPress permalink looks like this /%postname%



      This is my nginx configuration for the blog:



      location /blog {
      proxy_pass https://myblog.wpengine.com:443/;
      proxy_set_header Host myblog.wpengine.com;

      rewrite /blog/(.*) /$1 break;

      subs_filter_types text/html text/css text/xml;
      subs_filter 'myblog.wpengine.com' 'example.com/blog' gi;
      }


      This is the .htaccess file on my wordpress site:



      # BEGIN WordPress
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index.php$ - [L]

      RewriteRule (.+)/$ $1 [R=301,L]

      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]
      </IfModule>


      When I go to https://example.com/blog/ it loads the blog but when i go to https://example.com/blog/my-first-post it redirects to https://myblog.wpengine.com/blog/my-first-post



      How can I keep it all on the one URL without trailing slashes









      share







      New contributor




      user5834867 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have a website that connects to my blog using a reverse proxy to make the url look like this https://example.com/blog



      The blog is hosted on WordPress through wpengine. The website is on an Nginx server.



      What i am trying to do is redirect the trailing slash which i have done on WordPress website but then now the reverse proxy doesnt pick up all the posts and redirects to the wpengine site.



      My WordPress permalink looks like this /%postname%



      This is my nginx configuration for the blog:



      location /blog {
      proxy_pass https://myblog.wpengine.com:443/;
      proxy_set_header Host myblog.wpengine.com;

      rewrite /blog/(.*) /$1 break;

      subs_filter_types text/html text/css text/xml;
      subs_filter 'myblog.wpengine.com' 'example.com/blog' gi;
      }


      This is the .htaccess file on my wordpress site:



      # BEGIN WordPress
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index.php$ - [L]

      RewriteRule (.+)/$ $1 [R=301,L]

      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]
      </IfModule>


      When I go to https://example.com/blog/ it loads the blog but when i go to https://example.com/blog/my-first-post it redirects to https://myblog.wpengine.com/blog/my-first-post



      How can I keep it all on the one URL without trailing slashes







      nginx .htaccess reverse-proxy wordpress





      share







      New contributor




      user5834867 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      user5834867 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      user5834867 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 mins ago









      user5834867user5834867

      1




      1




      New contributor




      user5834867 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      user5834867 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      user5834867 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          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
          });


          }
          });






          user5834867 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f962343%2fhow-do-i-redirect-this-reverse-proxy-to-not-have-trailing-slash%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








          user5834867 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          user5834867 is a new contributor. Be nice, and check out our Code of Conduct.













          user5834867 is a new contributor. Be nice, and check out our Code of Conduct.












          user5834867 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Server Fault!


          • 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%2fserverfault.com%2fquestions%2f962343%2fhow-do-i-redirect-this-reverse-proxy-to-not-have-trailing-slash%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







          Popular posts from this blog

          Фонтен-ла-Гаярд Зміст Демографія | Економіка | Посилання |...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Маріан Котлеба Зміст Життєпис | Політичні погляди |...