Nginx manager redirections
Hi,
I've to make thousands of redirects for some domains and on Apache it's causing severe overhead.
I want to do with Nginx proxy reverse, but it's not working.
I've made a conf file on /etc/nginx/conf.d/users/username/domain/redirects_server.conf, one file example:
location ~* ^/?(catalogo/solar/baterias/301-0054-byd-bmu-premium-lvl-lvs-ip55|catalogo/solar/baterias/313-2003-tesla-accessory-kit-solar-ct-100a)(/.*)?$ {
return 301 https://domain/catalogo/solar/baterias;
}
But it's not working at all.
Any ideas? Thanks!
Edit: I've made a mistake on the config file on purpose, tested with nginx -t and says everything it's ok. It's not reading this file... why?
Edit2: The domain it's an addon domain. If I use the main domain folder to set the conf, Nginx reads the file, but the redirections are not working. So, any ideas on how to do to addon domains? Maybe this it's a bug, cPRex?
-
Hey there! I couldn't get this to work either, so I reached out to the EasyApache team for some clarification.
The addon domain path will need to use the custom subdomain format to be recognized, so the file structure for your custom configuration file would look like this:
/etc/nginx/conf.d/users/username/cpaddon2.com.cptest1.test/*.conf
Can you try using that as your path and see if you get better results?
0 -
Hi!
Yep, that's way it's working! It's fine for me, but should be clarified if this it's the way or the other way it's gonna be fixed.
Thanks!
0 -
This is the correct method, and I've already submitted a documentation update so we can get that out there in our docs to avoid confusion in the future. Thanks for bringing this up!
0
Please sign in to leave a comment.
Comments
3 comments