Configure dynamic redirects(nginx + SPA)
We have the website on Angular and NGINX on server. Website is dedicated to be an aggregator of information about public events(concerts, shows, movies)
As soon as it is SPA, we return the same index.html
on any request.
But we need to add possibility to dynamically configure redirects on our website – return 301 code for some requests.
This case is needed to let our managers to redirect users from one event page to another(for example some event has expired, but we want old link to redirect to new event or to totally another site).
As soon we need real 301 code to be sent(because of SEO and the fact that we might want to redirect to extenal websites), the only solution to make redirects – configure them on NGINX
But they need to be dynamic, so NGIXNG should be restarted each time we make changes in redirects list. This is not a solution obviously.
Is there better solutions(I know there must be)?
angular nginx redirect single-page-application
add a comment |
We have the website on Angular and NGINX on server. Website is dedicated to be an aggregator of information about public events(concerts, shows, movies)
As soon as it is SPA, we return the same index.html
on any request.
But we need to add possibility to dynamically configure redirects on our website – return 301 code for some requests.
This case is needed to let our managers to redirect users from one event page to another(for example some event has expired, but we want old link to redirect to new event or to totally another site).
As soon we need real 301 code to be sent(because of SEO and the fact that we might want to redirect to extenal websites), the only solution to make redirects – configure them on NGINX
But they need to be dynamic, so NGIXNG should be restarted each time we make changes in redirects list. This is not a solution obviously.
Is there better solutions(I know there must be)?
angular nginx redirect single-page-application
add a comment |
We have the website on Angular and NGINX on server. Website is dedicated to be an aggregator of information about public events(concerts, shows, movies)
As soon as it is SPA, we return the same index.html
on any request.
But we need to add possibility to dynamically configure redirects on our website – return 301 code for some requests.
This case is needed to let our managers to redirect users from one event page to another(for example some event has expired, but we want old link to redirect to new event or to totally another site).
As soon we need real 301 code to be sent(because of SEO and the fact that we might want to redirect to extenal websites), the only solution to make redirects – configure them on NGINX
But they need to be dynamic, so NGIXNG should be restarted each time we make changes in redirects list. This is not a solution obviously.
Is there better solutions(I know there must be)?
angular nginx redirect single-page-application
We have the website on Angular and NGINX on server. Website is dedicated to be an aggregator of information about public events(concerts, shows, movies)
As soon as it is SPA, we return the same index.html
on any request.
But we need to add possibility to dynamically configure redirects on our website – return 301 code for some requests.
This case is needed to let our managers to redirect users from one event page to another(for example some event has expired, but we want old link to redirect to new event or to totally another site).
As soon we need real 301 code to be sent(because of SEO and the fact that we might want to redirect to extenal websites), the only solution to make redirects – configure them on NGINX
But they need to be dynamic, so NGIXNG should be restarted each time we make changes in redirects list. This is not a solution obviously.
Is there better solutions(I know there must be)?
angular nginx redirect single-page-application
angular nginx redirect single-page-application
asked Nov 16 '18 at 9:17
Katerina PavlenkoKaterina Pavlenko
1,3621622
1,3621622
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53334748%2fconfigure-dynamic-redirectsnginx-spa%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53334748%2fconfigure-dynamic-redirectsnginx-spa%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown