Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6803615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:21:58+00:00 2026-05-26T19:21:58+00:00

upstream apache { server 127.0.0.1:8080; } server{ location ~* ^/service/(.*)$ { proxy_pass http://apache/$1; proxy_redirect

  • 0
upstream apache {
   server 127.0.0.1:8080;
}
server{
   location ~* ^/service/(.*)$ {
      proxy_pass http://apache/$1;
      proxy_redirect off;
   }
 }

The above snippet will redirect requests where the url includes the string “service” to another server, but it does not include query parameters.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:21:58+00:00Added an answer on May 26, 2026 at 7:21 pm

    From the proxy_pass documentation:

    A special case is using variables in the proxy_pass statement: The requested URL is not used and you are fully responsible to construct the target URL yourself.

    Since you’re using $1 in the target, nginx relies on you to tell it exactly what to pass. You can fix this in two ways. First, stripping the beginning of the uri with a proxy_pass is trivial:

    location /service/ {
      # Note the trailing slash on the proxy_pass.
      # It tells nginx to replace /service/ with / when passing the request.
      proxy_pass http://apache/;
    }
    

    Or if you want to use the regex location, just include the args:

    location ~* ^/service/(.*) {
      proxy_pass http://apache/$1$is_args$args;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an apache proxy between browser and my custom web server. So after
I have Apache running on a public-facing Debian server, and am a bit worried
I am using nginx as a frontend to an apache server. The config file
I've read upstream program from here ... http://xunitpatterns.com/Back%20Door%20Manipulation.html If the data store is external
I want to pass a request to an upstream server. The original url is
Since any exception thrown in netty handler stack will generate an upstream event and
Our setup is standard nginx (ver 0.7.59) + thin upstream servers on Debian lenny.
git-cherry lets me find all the commits missing from upstream. How do I find
Somewhere upstream of me, something happened that looks like unicode mangling. One symptom is
I have an issue when I try to rebase an upstream branch into a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.