Welcome! Log In Create A New Profile

Advanced

Problem with return 302 redirection, with Nginx 1.3.11 + Drupal 7

Mark Alan
January 23, 2013 06:48AM
Hello,

In order to redirect certain Drupal 7 functions to https I have
setup Nginx 1.3.11 as follows:

location ~* ^/(\?q=)?(?:user|admin|contact$) {
return 302 https://$host$request_uri;
}
# and then the usual:
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /index.php {
...
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass ...
}

While this works if called as:
http://example.com/user -> becomes https://example.com/user

This fails if called as:
http://example.com/?q=user -> stays http://example.com/?q=user

What should I do to get http://example.com/?q=user redirected to
https://example.com/user or, if that is not possible, to
https://example.com/?q=user ?

Thank you,
M.

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

Problem with return 302 redirection, with Nginx 1.3.11 + Drupal 7

Mark Alan January 23, 2013 06:48AM

Re: Problem with return 302 redirection, with Nginx 1.3.11 + Drupal 7

Francis Daly January 23, 2013 07:04AM

Re: Problem with return 302 redirection, with Nginx 1.3.11 + Drupal 7

António P. P. Almeida January 23, 2013 08:14AM

SOLVED Re: Problem with return 302 redirection, with Nginx 1.3.11 + Drupal 7

Mark Alan January 23, 2013 03:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 156
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready