SnapOverflow

SnapOverflow Logo SnapOverflow Logo

SnapOverflow Navigation

  • Home
  • Server
  • Ubuntu

Mobile menu

Close
  • Home
  • System Administrators
    • Hot Questions
    • New Questions
    • Tags
  • Ubuntu
    • Hot Questions
    • New Questions
    • Tags
  • Help
Home / server / Questions / 432743
Accepted
Tom Harrison Jr
Tom Harrison Jr
Asked: 2012-09-28 13:16:50 +0800 CST2012-09-28 13:16:50 +0800 CST 2012-09-28 13:16:50 +0800 CST

Providing a static IP for resources behind AWS Elastic Load Balancer (ELB)

  • 772

I need a static IP address that handles SSL traffic from a known source (a partner). The reason the IP needs to be static is that the partner requires this in order to maintain the PCI compliance.

Our servers are behind an AWS Elastic Load Balancer (ELB), which cannot provide a static IP address; many threads about this here.

My thought is to create an instance in EC2 whose sole purpose in life is to be a reverse proxy server having it's own IP address; accepting HTTPS requests and forwarding them to the load balancer.

Are there better solutions?

apache-2.2
  • 2 2 Answers
  • 2620 Views

2 Answers

  • Voted
  1. Best Answer
    Tom Harrison Jr
    2012-10-03T06:54:16+08:002012-10-03T06:54:16+08:00

    In the end, I implemented the requirement of our partner as follows:

    • launch an instance in AWS
    • allocate and attach an Elastic IP (EIP) to it
    • Installed Apache
    • (in our case, installed our SSL certificate)
    • Configured Apache as a reverse proxy server, forwarding to a CNAME that pointed to our ELB

    Here's a sample Apache virtual host configuration. I turned off NameVirtualHost and specified the address of our EIP. I also disabled a default host. If the partner desires, I will add a <Directory> block that accepts requests only from their IP range.

    <IfModule mod_ssl.c>
    # Catch non-SSL requests and redirect to SSL
    <VirtualHost 12.34.567.890:80>
      ServerName our-static-ip-a-record.example.com
      Redirect / https://our-elb-cname.example.com       
    </VirtualHost>
    # Handle SSL requests on the static IP
    <VirtualHost 12.34.567.890:443>
      ServerAdmin [email protected]
      ServerName our-static-ip-a-record.example.com
    
      # SSL Configuration
      SSLEngine on
      SSLProxyEngine on
      SSLProxyCACertificateFile /etc/apache2/ssl/gd_bundle.crt
      SSLCertificateFile    /etc/apache2/ssl/example.com.crt    
      SSLCertificateKeyFile /etc/apache2/ssl/private.key
      # Additional defaults, e.g. ciphers, defined in apache's ssl.conf
    
      # Where the magic happens
      ProxyPass / https://our-elb-cname.example.com/
      ProxyPassReverse / https://our-elb-cname.example.com/
    
      # Might want this on; sets X-Forwarded-For and other useful headers
      ProxyVia off
    
      # This came from an example I found online, handles broken connections from IE
      BrowserMatch "MSIE [2-6]" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0
      # MSIE 7 and newer should be able to use keepalive
      BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
    </VirtualHost>
    </IfModule>
    

    Hope this saves someone else some time in the future :-)

    • 4
  2. Michael Hampton
    2012-09-28T16:35:25+08:002012-09-28T16:35:25+08:00

    You don't need a "static" IP address to implement SSL; you do need a name in the DNS, for which the SSL certificate will be issued.

    The typical solution to this is to create a name in the DNS and then make it a CNAME for the DNS name given for the Elastic Load Balancer.

    • 3

Sidebar

Stats

  • Questions 681609
  • Answers 979841
  • Best Answers 279908
  • Users 287144
  • Popular
  • Answers
  • Marko Smith

    Can you pass user/pass for HTTP Basic Authentication in URL parameters?

    • 5 Answers
  • Marko Smith

    Ping a Specific Port

    • 18 Answers
  • Marko Smith

    Check if port is open or closed on a Linux server?

    • 7 Answers
  • Marko Smith

    How to automate SSH login with password?

    • 10 Answers
  • Marko Smith

    How do I tell Git for Windows where to find my private RSA key?

    • 30 Answers
  • Marko Smith

    What's the default superuser username/password for postgres after a new install?

    • 5 Answers
  • Marko Smith

    What port does SFTP use?

    • 6 Answers
  • Marko Smith

    Command line to list users in a Windows Active Directory group?

    • 9 Answers
  • Marko Smith

    What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats?

    • 3 Answers
  • Marko Smith

    How to determine if a bash variable is empty?

    • 15 Answers
  • Martin Hope
    Davie Ping a Specific Port 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    Smudge Our security auditor is an idiot. How do I give him the information he wants? 2011-07-23 14:44:34 +0800 CST
  • Martin Hope
    kernel Can scp copy directories recursively? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh returns "Bad owner or permissions on ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil How to automate SSH login with password? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin How do I deal with a compromised server? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner How can I sort du -h output by size 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent How to determine if a bash variable is empty? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus How do you find what process is holding a file open in Windows? 2009-05-01 16:47:16 +0800 CST

Related Questions

Trending Tags

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Home
  • Questions
    • Hot Questions
    • New Questions
  • Tags
  • Help

Footer

SnapOverflow

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Help

© 2022 SOF-TR. All Rights Reserve