proxy_pass works on main page but not other pages

Brian Carey biscotty666 at gmail.com
Sun Oct 30 17:41:31 UTC 2022


Okay I seem to have solved this. I re-wrote the app urls to mount all 
directories under /striker, something unnecessary for the app itself but 
necessary for nginx to properly forward. I also removed the rewrite rule 
below.

Thanks by the way for the help you give here.

Brian

On 10/30/22 11:20, Brian Carey wrote:
>
> Hi,
>
> I have an app running at port 8239 on biscotty.me. If I access the app 
> directly everything works as expected.
>
> I am able to use proxy_pass to forward https:/biscotty.me/striker to 
> the main page of my app. The problem is that all of the links in the 
> app result in a page not found error from the apache server handling 
> requests to /. So it seems like the port number information is somehow 
> being lost in translation?
>
> This is my conf:
>
> ```
>
> location /striker {
>                rewrite /striker/(.*) /$1 break;
>                proxy_pass http://192.168.0.238:8239;
>
> proxy_set_header X-Real-IP $remote_addr;
>                proxy_set_header X-Forwarded-For $remote_addr;
>                proxy_set_header Host $host:8239;
>
>        }
>
>        location / {
>                proxy_pass http://192.168.0.238:8080/;
>                proxy_buffering on;
>                proxy_buffers 12 12k;
>                proxy_redirect off;
>
>                proxy_set_header X-Real-IP $remote_addr;
>                proxy_set_header X-Forwarded-For $remote_addr;
>                proxy_set_header Host $host:8080;
>
>        }
>
> ```
>
>
> ```
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20221030/152ba1b5/attachment.htm>


More information about the nginx mailing list