By using AWS re:Post, you agree to the Terms of Use

Rails Cloud9 public preview w/ elastic ip not working with https


Hi there!

I followed all steps available at for sharing a Running Application over the Internet.
It worked well at port 8080.

It happens that my application has many interactions with Slack, that enforces the use of https.

After having configured the ACL and Security Group inbound rules to accept http and https ports (80,8080,8081,8082,443) I'm still unable to access it via https.

When using the preview url (ex: it works in https, but this address is only reachable from my browser.

Also, port 80 maps to Apache, not rails.

And when I try to run rails s -p 80 or 443, I get this error:
Permission denied - bind(2) for "" port 80 (Errno::EACCES)

How can I map the requests from all http/https ports for rails, as cloud9 used to do?

asked 3 years ago39 views
1 Answer

I've managed to solve with this apache2 conf. And buying a SSL certificate.

Yes, It's just a shame I had to buy a SSL certificate in order to receive api requests in my dev environment, just because AWS won't let the public address be accessed outside my browser :/

The whole Cloud9 migration for AWS was an awful experience.


<VirtualHost *:80>
    Redirect permanent / 

<VirtualHost *:8080>
    Redirect permanent / 

<VirtualHost *:8081>
    Redirect permanent / 

<VirtualHost *:8082>
    Redirect permanent / 

<IfModule mod_ssl.c>
	<VirtualHost _default_:443>
        DocumentRoot /home/ubuntu/environment

        ProxyPreserveHost On
        ProxyPass /
        ProxyPassReverse /

		SSLEngine on
		SSLCertificateFile /etc/ssl/certs/cert.crt
		SSLCertificateKeyFile /etc/ssl/certs/cert.key
		SSLCertificateChainFile /etc/ssl/certs/cert.crt
		<FilesMatch "\.(cgi|shtml|phtml|php)$">
				SSLOptions +StdEnvVars
		<Directory /usr/lib/cgi-bin>
				SSLOptions +StdEnvVars

		BrowserMatch "MSIE [2-6]" \
				nokeepalive ssl-unclean-shutdown \
				downgrade-1.0 force-response-1.0
		BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions