add the following two lines to your /etc/apt/sources.list file
Code:
deb http://nginx.org/packages/ubuntu/ trusty nginx
deb-src http://nginx.org/packages/ubuntu/ trusty nginx
download the nginx signing key:
Code:
cd ~
wget http://nginx.org/keys/nginx_signing.key .
add the key to the db:
Code:
apt-key add ~/nginx_signing.key
update the list of installable apps:
install nginx:
Code:
apt-get install nginx
create the file for your website in /etc/nginx/conf.d/ for example mysite.conf
Code:
server {
server_name sub.domain.net;
listen 80;
# access_log /var/log/nginx/access.log;
# error_log /var/log/nginx/error.log;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://domain.com:port/;
proxy_read_timeout 90;
proxy_redirect off;
}
}
then restart niginx
Code:
service nginx restart
That should get it working, could tweak a bunch of stuff, like add SSL at the proxy to encrypt everything coming from the back end, but leave that for another day lol
Social Networking Bookmarks