Need help optimizing nginx to redirect from HTTP/80 to HTTPS/443

Mark Alan varia at
Sun Feb 22 17:05:17 MSK 2009

Igor Sysoev wrote:
> Do you want to redirect
>     http://pma.clinicacgm.0/some/uri to just https://pma.clinicacgm.0/
> or to
>     https://pma.clinicacgm.0/some/uri


>  		rewrite ^ https://pma.clinicacgm.0/ permanent;
> or if you want to preserve URI:
>  		rewrite ^ https://pma.clinicacgm.0$request_uri? permanent;

Thank you. Both work and do their different jobs as intended.

>> 		index index.php;
> You do not need "index index.php" here as all requests are passed to fastcgi.

You are right. It shouldn't be there in the first place.

Thank you very much for the fast response.


More information about the nginx mailing list