I have a website mysubdomain.mydomain.com that needs to be redirected to myotherdomain.com/coming-soon
The application, which has existing users, needs to be redirected to another site on a completely different domain.
My EC2 machine is using nginx. I've tried modifying the /etc/nginx/nginx.conf
file by adding
server {
listen 443;
listen 80;
server_name *.mydomain.com;
return 301 http://www.reallifeglobal.com/coming-soon;
}
I've also tried various modifications to this including changing the server_name
to thinks like .mydomain.com
, *
, mysubdomain.mydomain.com
, but none of that seems to work.
When I go to the URL, it loads a completely blank page (instead of loading the existing app), but it does not redirect to the return url.
Also, I first tried to redirect straight through the DNS provider, but it's only working for http and they're making it very complicated for me to redirect https so I'm seeing what it takes to redirect on the AWS side of things.
I'm just a petty developer and don't know too much about devOps, anything else you need to know to help let me know.
EDIT sites-enabled: Inside the sites-enabled is a .conf file for elasticbeanstalk
map $http_upgrade $connection_upgrade {
default "upgrade";
"" "";
}
server {
listen 80;
location / {
proxy_pass http://docker;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}