YP
Size: a a a
YP
ГК
SD
EF
EF
server {да, это костыль, но не важно. меня другое интересует. мне нужно что бы приложение работало на /platform, но почему-то адрес в строке браузера сбрасывается с http://localhost/platform на http://localhost. метод делеия пополам нашел что url в браузере изменяет
listen 80;
listen [::]:80;
server_name localhost;
proxy_redirect off;
rewrite_log on;
access_log /var/log/nginx/host.access.log main;
location / {
if ($http_referer ~ .*/platform/?$) {
rewrite ^/(.*)/?$ /platform/$1 last;
}
root /opt/landing;
index index.html;
}
location /platform {
root /opt;
index index.html;
}
error_page 404 /404.html;
location = /40x.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
routes/RoutesConfig
:const App = observer(() => {можешь кто-нибудь подсказать как сделать так, что RoutesConfig строил url относительно /platform, а не относительно /?
const { pathname } = useLocation();
const excludeRoutes = [ROUTES.SIGNIN, ROUTES.SIGNUP];
return (
<>
<Header />
<RoutesConfig />
{!excludeRoutes.includes(pathname) && <Footer />}
</>
);
});
export default App;
SD
GO
EF
GO
DA
T
DA
LM
I
13
13
А
А