Welcome! Log In Create A New Profile

Advanced

Re: Invalid ports added in redirects on AWS EC2 nginx

Maxim Dounin
June 02, 2014 11:34AM
Hello!

On Sun, Jun 01, 2014 at 01:48:09PM -0400, allang wrote:

> On AWS, I'm trying to migrate a PHP Symfony app running on nginx. I want to
> be able to test the app by directly talking to the EC2 server and via an
> Elastic Load Balancer (ELB -the public route in).
>
> I've setup the ELB to decrypt all the SSL traffic and pass this on to my EC2
> server via port 80, as well as pass port 80 directly onto my EC2 server via
> port 80.
>
> Initially this caused infinite redirects in my app but I researched and then
> fixed this by adding
>
> fastcgi_param HTTPS $https;
> with some custom logic that looks at $http_x_forwarded_proto to figure out
> when its actually via SSL.
>
> There remains one issue I can't solve. When a user logs into the Symfony
> app, if they come via the ELB, the form POST eventually returns a redirect
> back to https://elb.mysite.com:80/dashboard instead of
> https://elb.mysite.com/dashboard which gives the user an error of "SSL
> connection error".
>
> I've tried setting
>
> fastcgi_param SERVER_PORT $fastcgi_port;
> to force it away from 80 and I've also added the

[...]

> fastcgi_param HTTPS $fastcgi_https;
> # fastcgi_param SERVER_PORT $fastcgi_port;
> #fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME
> /var/www/vhosts/mysite.com/web$fastcgi_script_name;
> include fastcgi_params;

Make sure you've commented out SERVER_PORT from the fastcgi_params
file.

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Invalid ports added in redirects on AWS EC2 nginx

allang June 01, 2014 01:48PM

Re: Invalid ports added in redirects on AWS EC2 nginx

Maxim Dounin June 02, 2014 11:34AM

Re: Invalid ports added in redirects on AWS EC2 nginx

allang June 02, 2014 12:44PM

Re: Invalid ports added in redirects on AWS EC2 nginx

ron ramos June 02, 2014 12:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 306
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready