Fedor,
On 1/9/23 03:43, Fedor Makarov wrote:
We have to webapps lundase and vvsguiden therefore, the options you
have suggested do not look applicable
Why not?
on debug I saw that RequestURI in request looks like
lundase/lundase/...
Probably because of this:
>>> RewriteRule ^(.*)$ http://localhost:9090/lundase/$1 [NC,P,L]
You are taking /lundase and turning it into /lundase/lundase
I think you should do this:
RewriteRule ^/rpc/invoker/(.*)$ http://localhost:9090/rpc/invoker/$1
[NC,P,L]
RewriteRule ^/api/(.*)$ http://localhost:9090/api/$1 [NC,P,L]
RewriteRule ^/mapi/(.*)$ http://localhost:9090/mapi/$1 [NC,P,L]
RewriteRule ^/lundase/(.*)$ http://localhost:9090/lundase/$1 [NC,P,L]
RewriteRule ^/vvsguiden/(.*)$ http://localhost:9090/vvsguiden/$1 [NC,P,L]
You can always rewrite /(not api|mapi|lundase|vvsguiden) to /lundase/$1
-- or, better yet, use a "permanent redirect".
But you need to remove the mangling of that URL or you will fight
against it for years.
-chris
Вторник, 27 декабря 2022, 22:06 +03:00 от Christopher Schultz
<ch...@christopherschultz.net>:
Fedor,
On 12/27/22 05:55, Fedor Makarov wrote:
proxy for local environment we use the js conf:
proxy: {
'/api/': {
target: 'http://localhost:8080/',
changeOrigin: false,
},
'/': {
target: 'http://localhost:8080/lundase',
changeOrigin: false
}
},
for normal lunch we use apache2.conf:
RewriteCond %{REQUEST_URI} ^(/api/|/mapi/|/binary/|/rpc/invoker/)
RewriteRule ^/rpc/invoker/(.*)$ http://localhost:9090/rpc/invoker/$1 [NC,P,L]
RewriteRule ^/api/(.*)$ http://localhost:9090/api/$1 [NC,P,L]
RewriteRule ^/mapi/(.*)$ http://localhost:9090/mapi/$1 [NC,P,L]
RewriteRule ^(.*)$ http://localhost:9090/lundase/$1 [NC,P,L]
What you are doing is trying to remove the context-path of the
application through URL re-writing which will probably cause endless
problems during the life of your application.
I have two possible suggestions for you:
1. Re-name your application from lundase to ROOT (to deploy it to /
instead of /lundase).
or
2. Don't try to remove the /lundase URL prefix as part of your URL
rewriting.
If you don't choose one or the other of these options, you will find
that you have many years of debugging and trying to fix up every little
weird thing that happens with cookies, redirects, and in-page links.
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---
Fedor Makarov
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org