0

I have the following Nginx configuration, but I need to convert it to be compatible with Apache. I have almost zero experience in networking and have no clue where to begin.

location ^~ /static {
    proxy_pass http://127.0.0.1:8501/static/;
}

I'd really appreciate it if someone could give me some hints.

2

It's pretty self-explanatory... (Apache Docs)

Your equivalent command syntax in Apache would basically be, I believe, something like this:

ProxyPass "/static" "http://127.0.0.1:8501/static/"

(You may also have to do `"/static/" possibly, but I would have to do further testing.)

Alternatively, this may be what you want instead:

<Location "/path/to/docroot/static">
    ProxyPass "http://127.0.0.1:8501/"
</Location>
2
  • Thanks for the response. What about the regex part? "^~" – Blademaster Sep 24 '20 at 18:06
  • @Blademaster ^~ is processed as non-regex. From the NGINX docs: If the longest matching prefix location has the “^~” modifier then regular expressions are not checked. – Thomas Ward Sep 24 '20 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.