We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Opencart multistore + Nginx + SSL Redirect to WWW
Opencart multistore + Nginx + SSL Redirect to WWW
Hello,
I hired someone to fix the redirect 301 for me, he had to separate the multidomains aliases in 3 nginx config files for the redirection to work properly, but at the same time this broke the Vestacp web
control for the domains, since Vestacp works with 1 file when aliases are added, i had to renew letsencrypt using ssh instead.
the following command had some issues return 301 https://www.$server_name$request_uri;
the only thing that is working correctly with the command https://www.$server_name$request_uri;
the guy i hired used the following command return 301 https://www.$host$request_uri; in 3 files that made redirection work properly
using it in 1 file also created issues like
the redirection change was made in the domain.com.nginx.conf file nothing changed in domain.com.nginx.ssl.conf
You can check the configurations
Now i have moved to a new server and prefer to use 1 nginx config file for opencart multistore that can redirect all my stores correctly to https://www. would appreaciate if someone have a solution and can help
using apache .htaccess was much easier, but then that option have other issues with performance
I hired someone to fix the redirect 301 for me, he had to separate the multidomains aliases in 3 nginx config files for the redirection to work properly, but at the same time this broke the Vestacp web
control for the domains, since Vestacp works with 1 file when aliases are added, i had to renew letsencrypt using ssh instead.
the following command had some issues return 301 https://www.$server_name$request_uri;
Code: Select all
https://a.com/ would not redirect to https://www.a.com/
https://b.com/ would not redirect to https://www.b.com/
https://c.com/ would not redirect to https://www.c.com/
Code: Select all
http://www.b.com redirects to https://www.a.com/ (main store)
http://www.c.com redirects to https://www.a.com/ (main store)
Code: Select all
http://www.a.com/ redirects to https://www.a.com/
using it in 1 file also created issues like
Code: Select all
http://www.a.com redirects to https://www.www.a.com
http://www.b.com redirects to https://www.www.b.com
http://www.c.com redirects to https://www.www.c.com
Code: Select all
https://a.com dont redirect to https://www.a.com
https://b.com dont redirect to https://www.b.com
https://b.com dont redirect to https://www.b.com
You can check the configurations
Code: Select all
server {
listen XX.XX.XX.XX:80;
server_name a.com www.a.com www.b.com www.c.com b.com c.com;
return 301 https://www.$host$request_uri;
root /home/admin/web/a.com/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/a.com.log combined;
access_log /var/log/nginx/domains/a.com.bytes bytes;
error_log /var/log/nginx/domains/a.com.error.log error;
location /multiscraper/ {
try_files $uri $uri/ /multiscraper/index.php?$args;
}
location / {
try_files $uri $uri/ @opencart;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9002;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
location @opencart {
rewrite ^/(.+)$ /index.php?_route_=$1 last;
}
location /vstats/ {
alias /home/admin/web/a.com/stats/;
include /home/admin/conf/web/a.com.auth*;
}
error_page 403 /error/404.html;
error_page 404 /error/404.html;
error_page 500 502 503 504 /error/50x.html;
location /error/ {
alias /home/admin/web/a.com/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;
include /home/admin/conf/web/nginx.a.com.conf*;
}
Now i have moved to a new server and prefer to use 1 nginx config file for opencart multistore that can redirect all my stores correctly to https://www. would appreaciate if someone have a solution and can help
using apache .htaccess was much easier, but then that option have other issues with performance