I am trying to configure host name like www.abc.com on my already setup of nginx server with server_name like www.test.com. Both test.com and abc.com have different ssl certificates.
I have configured server for www.abc.com like below
server {
listen 443 ssl;
server_name www.abc.com;
ssl_certificate /usr/local/etc/nginx/ssl/self1.crt;
ssl_certificate_key /usr/local/etc/nginx/ssl/self1.key;
location /temp {
proxy_pass https://www.test.com/;
}
}
I am curious whether this is the proper way to achieve this or there is any better way. Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there @akshaybande81,
If you want to show the same content on www.abc.com as you do on test.com, what you could do is to copy the existing Server Block that you have for test.com and just change the server_name.
That way the two sites will have separate Nginx server blocks and separate SSL certificates, but they will be showing the same content.
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.