Drupal 7 in subfolder behind reverse proxy, login not working I'm trying to run a Drupal 7.12 site behind an nginx reverse proxy, so that it shows up in a sub-folder to the primary domain (company.com).

Nginx is handling all incoming traffic to http://company.com, and Drupal is installed on another server with Apache. We want the content from Drupal to show up under http://company.com/drupal/.

For nginx, there is a proxy_pass specified like this:

  location /drupal/ {
    proxy_pass http://drupal.company.com/;
  }


For Drupal, I have set 

$base_url = http://company.com/drupal;


This works fine to browse the content, Drupal is generating correct links, etc.

But when I try to login /drupal/user, I get the login form, but the action parameter for the form is set to "/user" - it seems that Drupal is forgetting to apply the base_url here.

Any ideas how to solve this issue? Help appreciated...
As I understood, the #action on the page /user is generated by request_uri, the default action of each form, except for few form that are block (check if the user_login block has the same problem).

I can advise you, to check your PHP config in Report -> Status report and then click on the PHP version an try to find the REQUEST_URI information, this can be different from what you are expecting (I guess /drupal/user).

To fixe it, I see only two solutions, submit an issue (or check if that issue already exists) or the second its to use the hook_form_alter and replace the #action by something like that.

$form['#action'] = url(current_path(), array('external' =&gt; FALSE));