Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi, I’m new to Digital Ocean, and also to nginx.
I have a droplet hosting a couple of different sites, and most traffic for a domain—let’s call it domain.com—should be hosted here. But sub.domain.com needs to redirect to a specific URL, e.g. 12.34.56.78/a/particular/path/.
It seems like DNS only directs to servers, and so I need to create a subdomain-specific redirect.
My file in /etc/nginx/sites-available looks like this:
server {
server_name domain.com;
root /var/www/domain/html;
access_log /var/log/nginx/www.demo.com.access.log;
error_log /var/log/nginx/www.demo.com.error.log;
# INCLUDE CONFIG INFO COMMON TO ALL SITES
include global/common.conf;
# INCLUDE COMMON WORDPRESS INFO
include global/wordpress.conf;
include fastcgi_params;
fastcgi_param SERVER_NAME $host;
fastcgi_param DOCUMENT_ROOT root;
}
server {
server_name sub.domain.com;
rewrite ^(.*) http://12.34.56.78/a/particular/path/ permanent;
}
This does not seem to be working, and my browser returns an ERR_NAME_NOT_RESOLVED.
How do I redirect that subdomain traffic to that external address? Note: I want the address in the browser to still say ‘sub.domain.com’.
Thanks anybody for your help!
ebeecroft
68aa2215160846bca0a00f952c5fdc
009fd274aeae48f2bfbda6ef568676
Cloudstream Apk
032f50ee7f7d489db3b05e204fe139
032f50ee7f7d489db3b05e204fe139
Edward Sitarski
ebeecroft
dashan
34bcef38725b4e6eb5224ae028f17e