Welcome! Log In Create A New Profile

Advanced

Help with reverse proxy config

Posted by Faulteh 
Help with reverse proxy config
December 29, 2020 09:15AM
Hey there,

I'm trying to simply a reverse proxy config and cement my own understanding. Here's the scenario:

I have a test page at http://domain.com/testpage

that contains a script block with "testscript/somejavascript.js"

This script block after testing will also end up on http://domain.com main page...

My nginx config looks like

location ~* /testscript/ {
proxy_pass https://someotherwebserver;)


With only that config, calls to http://domain.com/testpage/testscript/whatever.js fail with a 404 as nginx is also passing the /testpage/ URI to the backend webserver.

Ultimately, I would like to have any requests that contain /testscript/ to be passed to the root of someotherwebsever and I'm not sure how to accomplish this as with regex I can't append the trailing / to my proxy_pass.


Thanks.
Re: Help with reverse proxy config
December 29, 2020 10:16AM
So, I made this work with a rewrite.

Ultimately what I will need to do is come up with a rewrite rule that will drop any preceding path probably. Oh well, good to know I can make it work!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 294
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready