FeaturesWP CloudPricingEE CLIContactMy Account

Features

Team Access & User Permissions

Server Setup & Management

Site Creation & Management

Deployments & Developer Tools

Firewall Protection

Speed & Caching

Backups & Recovery

Logs & Monitoring

Create WP Cloud Sites

All Features

Read Documentation

Install

Installation Guide

FAQ

Roadmap

Explore EE CLI

Resources

Commands

Handbook

Blog

Community

Forum

EasyExperts

Tutorials

Subscribe

Github

CLEAR

Start For Free

separator Tutorials separator Nginx separator Amazon Elastic Load Balancer and Forwarding Real-IP Nginx

Topics

On this page

Security Consideration:

Amazon Elastic Load Balancer and Forwarding Real-IP Nginx

This article is for Amazon AWS only. For forwarding visitor real IP in nginx proxy setup, check this.

If you are running nginx on Amazon EC2 instance, behind Amazon Elastic Load Balancer (ELB), for any IP-specific nginx config and/or applicaiton code to work, you need to do following:

Open /etc/nginx/nginx.conf file

Add following inside http {..} block


			real_ip_header X-Forwarded-For;
set_real_ip_from 0.0.0.0/0;
		

Then just reload nginx for change to take effect.

Security Consideration:

If your nginx EC2 instance can be accessed directly, apart from traffic coming through Elastic Load Balancer, then its better to change:


			set_real_ip_from 0.0.0.0/0;
		

to fixed IP address assigned to Elastic Load Balancer.

If IP address for ELB is 1.2.3.4, then it should look like:


			set_real_ip_from 1.2.3.4;
		

Adding $upstream_cache_status in HTTP Response Headers

PREVIOUS

Block wp-login.php bruteforce attack

NEXT


Comments

  1. Philip Avatar

    Philip

    February 2, 2014

    Thanks. That really helped me out after reading 10 other suggestions that didn’t work 🙂

    1. Rahul Bansal Avatar

      Rahul Bansal

      February 6, 2014

      Glad to know that. 🙂

Features

Useful Links

Product

Other Products

Subscribe for curated product updates, tips, and announcements.

"*" indicates required fields

Name

This field is for validation purposes and should be left unchanged.

Email*

SIGN ME UP

Δ


© rtCamp, since 2009. All rights reserved.

Powered by