Answer the question
In order to leave comments, you need to log in
Is it possible to redirect https from one domain to another https domain?
There is a problem, we have one example.com domain and the test.com
example.com domain should redirect to test.com ( test.com sits behind ssl)
server {
listen 80;
server_name example.com www.example.com;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
location / {
return 301 https://test.com/test-test;
}
}
server {
server_name example.com www.example.com;
rewrite ^/(.*) https://test.com/test-test;
listen 443 ssl http2; # managed by Certbot
ssl_certificate /etc/le/example/fullchain.pem;
ssl_certificate_key /etc/le/example/privkey.pem;
include /etc/le/options-ssl-nginx.conf;
ssl_dhparam /etc/le/ssl-dhparams.pem; #
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question