How to Install Nginx as a reverse proxy server

Let’s assumeyou have Nginx installed, here are the steps to set up reverse proxy server:

1. create a config file under /etc/nginx/sites-available/leespace.com
2. Change the configure by editing example.com to have the following:

server {
    listen 80;

    server_name leespace.com www.leespace.com;

    location /blog {

        proxy_pass http://localhost:88/blog;
        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;

    }
}

3. Create a symbolic link :
sudo ln -s /etc/nginx/sites-available/leesapce.com /etc/nginx/sites-enabled/leesapce.com

4. Restart nginx server with : service nginx restart

5. Optional step : set up your land page at /usr/share/nginx/html