Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hey,
I’ve been trying lately to do two things on my server:
The server is running on nginx.
My domain (sub.domain.com) is set to get html files at the following root: /usr/share/nginx/html.
The redirect works fine with this added to the /etc/nginx/nginx.conf file:
server {
...
location = / {
return 301 /folderone/foldertwo/;
}
...
}
My problem comes when this happens. It logically redirects the user via a url redirect. So the browser is no longer showing sub.domain.com but sub.domain.com/folderone/foldertwo/, which makes perfect sense. Now what i’m trying to do is rewrite this url and remove those two folders from it to be back at sub.domain.com from a visual point of view.
I’ve tried several things, among:
location = /folderone/foldertwo/ { rewrite... }
location / {
if ($http_host ~ "^sub.domain.com"){
rewrite ^(.*)$ http://sub.domain.com/folderone/foldertwo/$1 redirect;
}
}
location /issue {
rewrite ^/issue(.*) http://$server_name/shop/issues/custom_issue_name$1 permanent;
}
I’m wondering if this can be achieved since i’m trying to redirect to a specific folder and then almost “redirect” to the root.
If possible, should the rules be in the same server directive? Same location block? Is an alias the solution?
Thanks.
ebeecroft
68aa2215160846bca0a00f952c5fdc
009fd274aeae48f2bfbda6ef568676
Cloudstream Apk
032f50ee7f7d489db3b05e204fe139
032f50ee7f7d489db3b05e204fe139
Edward Sitarski
ebeecroft
dashan
34bcef38725b4e6eb5224ae028f17e