TechAtNYU / tech-nyu-site

https://techatnyu.org
8 stars 5 forks source link

Redirect HTTPS traffic to HTTP #34

Open ethanresnick opened 10 years ago

AbhiAgarwal commented 10 years ago

We can do this by editing our nginx.conf. I can get this setup for both site/api and document it.

thebyrd commented 9 years ago

wait, why is nginx running?

You can do port forwarding w/ iptables

iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
AbhiAgarwal commented 9 years ago

No nginx running! We're using iptables - this was when I thought we were going to be having both the API/website on the same server.

thebyrd commented 9 years ago

ah, perfect. Ok, well in order to get cloudflare to work with ssl, I think you need to also forward to 443

AbhiAgarwal commented 9 years ago

@ethanresnick: are there any subdomains in the techatnyu.org website that needs to be using SSL? We can remove the api.techatnyu.org b/c that's the only one that comes to mind that needs to run using SSL.

I don't think we should using cloud for tnyu.org yet.

I get what you mean! Yeah I'll just do a redirect

ethanresnick commented 9 years ago

@AbhiAgarwal I think we should assume that, at some point, we may have other subdomains on techatnyu.org that use SSL. So cloudflare should be set up to support that, if possible.

But, for right now, I was just suggesting doing a simple 301 redirect to http.