Ubuntu Server 14.04 LTS. I'm running WordPress as a standard install, i.e in /var/www/html. I also have a Discourse instance running in a Docker container, with port 8081 exposed. My intention is to have the WP instance at domain.com and Discourse on sub.domain.com. I've tried using nginx to intercept requests for sub.domain.com but it doesn't seem to be working - it just sends everything to domain.com. What have I done wrong?
/etc/nginx/sites-enabled/sub.domain.com:
server {
listen 80;
server_name sub.domain.com;
location / {
proxy_pass http://localhost:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}